haiku/headers/os/interface
John Scipione 7c095f4709 BeControlLook: Fix app integration drawing issues
Update BTab::DrawTab() to pass the current index, the index of the
selected tab, and the index of the first and last tabs into
BControlLook::DrawActiveTab() and BControlLook::DrawInactiveTab().
This allows you to draw tabs differently in your BTab or BControlLook
subclass in many different circumstances.

Modify BControlLook API to add indexes to DrawActiveTab() and
DrawInactiveTab() like so:

void DrawActiveTab(..., int32 index = 0, int32 selected = -1,
	int32 first = 0, int32 last = 0);
void DrawInactiveTab(..., int32 index = 0, int32 selected = -1,
	int32 first = 0, int32 last = 0);

These extra indexes are not used by HaikuControlLook which relies only
on if the tab is active or inactive to draw.

Add IndexOf(BTab* tab) method to BTabView and document it to get the
index of the current tab in BTab::DrawTab(). Also add a warning in the
BTabView::DrawTab() method not to use the position and full parameters
anymore, use BTabView::IndexOf(), BTabView::Selection(), and
BTabView::TabCount() to get the info you need.

Using a dynamic_cast to a BTabView in BeControlLook to determine if the
view is derived from a BTabView didn't work in the case of WebPositive.
Furthermore, WebPositive does custom tab drawing which needed to be
updated for alternative control look. These index parameters passed from
BTab to BeControlLook allow us to draw the tab like BeOS without relying
on a dynamic_cast to BTabView to get the info.

Reproduce the functionality described above for BTab in WebPositive's
custom tabs. Eliminate no longer needed code in favor of using indexes.
Update WebPositive custom tabs to use BControlLook::DrawTabFrame()
instead of BControlLook::DrawInactiveTab() matching the update made in
BTabView.

In BeControlLook::DrawTabFrame() fill rect with base color, WebPositive
doesn't draw any tab background, so it expects this work to be done for
it.

Eliminate hasFrames variable from WebPositive.

Rename TabSelected(index) to UpdateSelection(index) in WebPositive to
better reflect its purpose.

Adjusted HaikuControlLook::DrawInactiveTab() to draw the tab borders more
selectively. Only draw border if left border is set for top and bottom tabs
or top border is set for left and right tabs. Undo no longer needed frame
manipulation border drawing workaround in HaikuControlLook::DrawTabFrame().

Draw scroll bar triangle without using DrawArrowShape().

Unlike in HaikuControlLook, DrawArrowShape() is used to draw arrows in
BOutlineListView and menus distinctly from how it draws arrows in scroll
bars. Draw our distinct arrows in DrawSrollBarButtons() instead.

This fixes overflow of time edit up-down arrows in Clock prefs and the
collapse-expand arrow in Deskbar not being vertically centered.

In DrawBorders() only inset if we actually draw the border.

Fix alignment issues with DrawSliderThumb dots for example in
MediaPlayer volume knobs.

Draw using line arrays calling AddLine instead of StrokeLine in
several places.

DrawMenuBar() extends to draw final pixel which eliminates an extra
lines at the end of menu bars.

Truncate button labels better fixing a few issues for example keymap
keyboard layout button labels. Button insets has been updated a bit
to fix drawing issues with buttons missing a border.

Using a dynamic_cast to a BButton to determine if a view is a button
in BeControlLook didn't work in the case of the keymap label. Look for
B_FLAT, B_HOVER, or B_DEFAULT_BUTTON flag in BeControlLook::DrawLabel()
to draw the label inverted on click. Pass the B_FLAT flag from Keymap
keys when drawing using BControlLook so that the label is inverted.

Change-Id: I07631f4b006bdb9aeca2adc9cbdf2da54dae8e92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2866
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-10-11 15:50:18 +00:00
..
AbstractLayout.h More whitespace cleanup all over the place. 2015-04-10 15:05:14 +02:00
AbstractLayoutItem.h Make archiving hooks protected in layout classes. 2011-12-01 20:45:50 -07:00
AffineTransform.h BAffineTransform: Remove "register" storage class. 2019-02-21 14:03:05 -05:00
Alert.h BAlert: use layout API, allow any number of buttons. 2015-07-30 19:50:03 +02:00
Alignment.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
Bitmap.h Package daemon notifications 2017-07-31 19:09:38 +02:00
Box.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
Button.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
CardLayout.h Add a bit more FBC stuff for the Layout API, which I missed before. 2011-12-01 22:47:46 -07:00
CardView.h Interface Kit: Add BCardView 2015-12-26 20:13:22 -05:00
ChannelControl.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
ChannelSlider.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
CheckBox.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
ColorControl.h BColorControl: Remove fOffscreenView pointer 2016-03-12 19:14:26 -08:00
Control.h Style fixes to IK, focus on docs 2014-06-13 17:27:01 -04:00
ControlLook.h BeControlLook: Fix app integration drawing issues 2020-10-11 15:50:18 +00:00
Deskbar.h Deskbar: Resizable tray 2018-11-04 19:00:49 +00:00
Dragger.h Fix clang warning "mismatched-tags" 2020-03-23 01:30:23 +00:00
Font.h Implementation of BFont::Blocks 2017-05-08 22:17:53 +02:00
Gradient.h BGradient: fix assignment operator, add copy constructor 2020-08-11 20:46:34 +00:00
GradientConic.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
GradientDiamond.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
GradientLinear.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
GradientRadial.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
GradientRadialFocus.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
GraphicsDefs.h app_server: Implement more composition modes 2020-06-29 14:07:42 +00:00
GridLayout.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
GridLayoutBuilder.h Add default spacing for Layouts (#5614) 2010-09-02 22:58:24 +00:00
GridView.h Add FBC padding + Perform() methods to GridView and GroupView. 2011-11-04 23:08:11 -06:00
GroupLayout.h More whitespace cleanup all over the place. 2015-04-10 15:05:14 +02:00
GroupLayoutBuilder.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
GroupView.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
IconUtils.h * Add BIconUtils documentation to the Haiku Book 2011-08-09 19:31:46 +00:00
Input.h Optimized includes. For example, BeBuild.h is almost always already included 2009-08-27 12:36:35 +00:00
InterfaceDefs.h Input: declare BString to get the Mouse Name 2020-09-10 17:15:09 +00:00
Layout.h Make archiving hooks protected in layout classes. 2011-12-01 20:45:50 -07:00
LayoutBuilder.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
LayoutContext.h Add FBC padding to all (I think..) of the visible Layout related classes. 2011-11-02 00:29:33 -06:00
LayoutItem.h BLayoutItem: Add RemoveSelf() convenience method. 2015-04-15 00:34:05 +02:00
LayoutUtils.h Fix button label position, try number 2 2014-04-08 14:10:10 -04:00
ListItem.h * Added BListItem::SetOutlineLevel() method. 2010-05-07 11:24:25 +00:00
ListView.h BListView: do not spawn a thread on every mouse click. 2020-04-04 11:50:07 +02:00
Menu.h BMenu: speed up deleting items 2020-07-04 16:49:55 +00:00
MenuBar.h BMenuBar & Deskbar: Make the hack to call ShowMenuBar a lot less ugly. 2019-06-17 11:49:48 +00:00
MenuField.h Remove MouseDownThread and its usages 2020-05-07 22:08:23 +00:00
MenuItem.h Visually align shortcuts in menus 2020-02-04 23:06:54 +00:00
OptionControl.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
OptionPopUp.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
OutlineListView.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
Picture.h BPicture: Style fixes related to documentation. 2014-05-19 20:13:38 -04:00
PictureButton.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
Point.h Various whitespace cleanup only. 2015-09-05 16:09:33 +02:00
Polygon.h BPolygon: Style fixes for documentation. 2014-05-21 16:12:47 -04:00
PopUpMenu.h BPopUpMenu style fixes for documentation, no functional change intended 2013-11-11 19:27:45 -05:00
PrintJob.h PrintJob: make struct print_file_header packed. 2017-07-31 17:11:53 +02:00
RadioButton.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
Rect.h BRect: Style fixes for documentation 2014-05-30 19:31:10 -04:00
Region.h BRegion: add ScaleBy(BSize) and user documentation. 2014-06-19 19:23:31 +02:00
Screen.h Style fix: parameters should have a name. 2017-11-21 12:19:56 +01:00
ScrollBar.h BScrollBar: Remove DISABLE_ON_WINDOW_DEACTIVATION constant. 2020-07-05 18:37:48 -04:00
ScrollView.h BScrollView: Ask the BScrollBars what their preferred sizes are. 2020-07-05 18:37:48 -04:00
SeparatorItem.h BSeparatorItem: Style fix, rename archive to data 2014-03-04 14:28:20 -05:00
SeparatorView.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
Shape.h BShape: Rename these params back in header. 2014-07-14 19:15:13 -04:00
Shelf.h Fix clang warning "mismatched-tags" 2020-03-23 01:30:23 +00:00
Size.h Finished unifying the Interface Kit headers: 2009-08-27 11:12:41 +00:00
Slider.h Slider: Style fixes 2016-03-22 12:00:36 -07:00
SpaceLayoutItem.h Add a bit more FBC stuff for the Layout API, which I missed before. 2011-12-01 22:47:46 -07:00
SplitLayoutBuilder.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
SplitView.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
StatusBar.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
StringItem.h * add protected accessor for baseline offset to StringItem, as that value is of 2011-08-21 17:17:13 +00:00
StringView.h BStringView: add support for multiline strings 2018-11-03 16:44:10 +00:00
TabView.h BeControlLook: Fix app integration drawing issues 2020-10-11 15:50:18 +00:00
TextControl.h Set*UIColor, etc. 2016-01-04 06:48:22 -05:00
TextView.h IK: align BTextView text rect/fix alignment 2020-09-07 22:10:36 +00:00
TwoDimensionalLayout.h Remove enum elaborated type specifier 2013-07-08 19:29:11 -04:00
UnicodeBlockObjects.h Implementation of BFont::Blocks 2017-05-08 22:17:53 +02:00
View.h Actually handle more than 3 mouse buttons 2020-04-18 18:20:37 +00:00
Window.h Revert "BWindow: CenterOnScreen a bit above center" 2017-01-01 12:25:05 -08:00