Call newly created BDeskbar methods to adjust default Zoom().
if auto-hide is turned on don't consider Deskbar's frame.
In vertical mode allow windows to zoom on top of Deskbar if
auto-raise or always on top is turned on.
Deskbar can take up a significant area so you can reclaim that
space by turning on auto-raise or always on top.
In horizontal mode ignore auto-raise and always on top settings,
don't allow windows to zoom on top of Deskbar even if these
settings are turned on.
Deskbar doesn't take up very much space and you don't want your
window to get cut-off at the bottom.
Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.
Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.
Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.
Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.
Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.
The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.
Zoom() takes up all Desktop area excluding the area
occupied by Deskbar. This is calculated using information
from the BDeskbar class.
Window zooms just as you'd expect -- it takes up fullscreen
minus area taken up by Deskbar. In vertical mode the zoom
area depends on the width of Deskbar, consequently Zoom()
is more space efficient in horizontal mode than vertical
mode because the window doesn't use the area below Deskbar.
If the zoom limits are smaller than the Desktop area, the
zoom area shrinks towards the center of the Desktop not
covered by Deskbar. This is slightly different behavior,
the window insets off-center following Deskbar.
In some scenarios zooming to the non-Deskbar area was too
restrictive. I made an exception that if there is enough
room above or below Deskbar i.e. a short window, then Zoom()
instead insets from the screen edge ignoring Deskbar. Apps
which meet this criteria include DriveSetup and Expander.
* When a view is used with the layout system, its initial frame rect
was set to (0, 0, 0, 0), which is a BRect covering 1 pixel in the
top left corner of the window.
Since this a valid rect, it can cause "badly behaved" views to
trigger redraws of themselves and other views during the layout
process, which is ultimately the reason for the HaikuDepot UI
freezing while populating with packages.
The misbehaving view in this case is BTextView. When in read-only
mode, since commit e27a53b2, its GetHeightForWidth() implementation
causes the view to resize (really resizing, not just simulating a
resize) and thus it invalidates itself. This is broken behaviour,
and needs to be fixed in BTextView. Since GetHeightForWidth() is
called during the layout process, all the not-yet-layouted views
have a frame of (0, 0, 0, 0). The invalidation of just the one
BTextView in the layout then hits *all* new views that are being
layouted (because they all occupy the same one pixel in the
corner), and they all get redrawn.
Many view Draw() implementations ignore the update rect, so work
is being done. And even if not, this can cause a lot of traffic
on the app_server link. In a test case with HaikuDepot's
FeaturedPackagesView, adding 300 rows (each containing a BTextView,
among other views) in quick succession caused over 6 million
commands to travel over the app_server link, completely freezing
the UI for a long time.
* The actual problem here is in BTextView::GetHeightForWidth() and
must be fixed there.
However we also put in an extra-fix here because it never makes
sense anyway to try and draw a view that has not yet been layouted.
So we set the initial BView frame to an invalid rect
(0, 0, -1, -1), which will suppress any actual updating, even
when the view actively invalidates itself, as long it doesn't
have a size yet. (The dirty region will always end up empty
then).
* Fixes HaikuDepot UI freezing during package population (caused by
above described behaviour from BTextViews in FeaturedPackagesView).
Might improve performance in other applications using BTextView
with layouting as well.
because the bound scrolls to the current cursor to view the text (ScrollToOffset).
Follow up #12608
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
* Actually set status before testing it
* sscanf (reads from passed buffer) not scanf (reads from stdin)
* &httpStatus not httpStatus.
Found by Coverity.
Thanks PulkoMandy for teaching me how to use Debugger and part of the interface kit..
Fixes#12608
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Thanks for investigating and finding the problem!
It is not a good idea to have a thread get an address from the request
cache, while another thread is deleting said address as the cache has
grown too large. Add a lock around the cache access to make it safe.
Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.
App_server:
Forward brightness things between BScreen and the accelerant.
intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.
Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.
We just want to disable known broken ones, rather than opt-in for
working ones. This keeps the list of authentications shorter and is more
future proof.
Make TitleView a few pixels shorter at the default font size so that
it lines up with the scroll bar arrow to its immediate right.
Note the font size used in the title view before and still is 9px
(12px * 3/4)
Make this the minimum TitleView height even for smaller font sizes
so that the title view never is shorter than the height of a
scrollbar button. Make the minimum font size for TitleView 8px
because 6px (8px * 3/4) was just too small to read.
As font size is made larger it will increase the height of the
titlebar to accomodate the increased font size and consequently no
longer line up with the scrollbar arrow.
The code to scale the bar height via the font height was taken from
BColumnListView. The code to position the title in the middle of the
title bar was also taken from BColumnListView.
Some included style fixes:
* Rename height to fontHeight
* Rename loc to titleLocation
* 80 column limit
BListView's property_info list lacked termination, resulting in
garbage output at the and of 'hey getsuites'.
Use { 0 } everywhere for sake of consistency.
Thanks to waddlesplash for spotting the bug an providing the easy fix.
* Fix bug reported by humdinger: when the volume which is
currently shown in the file panel is unmounted, the file
panel's window was closed and even deleted. This is not only
inconvenient but also a use-after-free bug waiting to happen:
an application which keeps the BFilePanel around to show it
again later (as recommended in the BeBook) cannot know that
it has become invalid while it was hidden (the destruction of
the window happens even when it's not shown).
* When receiving an unmount event for the currently shown volume,
we now reset the view to the home directory.
Removing tabs tries to preserve the keyboard focus, but it should also
preserve the absence of it.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
_FindView finds a view that contains a specific BPoint (usually used to
dispatch a mouse event to it). It should ignore hidden views, but not if
they are hidden because of their parent.
In particular, if the whole window is hidden (for example, it is used to
draw onto a BBitmap), this should not be taken into account here.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
BChannelSlider (used in media preferences) used to implement its own
tooltip, which didn't really work (as it could draw only inside the
view), and had hardcoded colors.
Use the native BToolTip which was added to Haiku since then.
All of its prior functionality has been moved into HaikuControlLook.
This paves the way for customizeable control looks, which I intend to implement
in the future as part of decorators.
This is being pushed now because libbe ABI was already broken due to the
Notifications changes, so this is riding that so we only have to do a mass
rebuild once.
Notifications preflet:
-Use sliders instead of text fields for width and timeout
-Remove icon size choice (mini icon looks horrible)
-Consolidate both "Enable" checkboxes into one
-Fix Revert button, remove Apply button, add Defaults button
-All changes to settings saved immediately
-Live example notification message shown when settings changes are made
-Add setting for individual apps to specify whether their notifications
should be muted
-Remove history list (to be implemented later)
BNotification class:
-BNotification records the signature and name of application that
created it
-New functions to get source application signature and name
Notification Server:
-Notification pop up view layout fixes and bold font size fix
-Remove notifications history from AppUsage class (will be saved in
cache instead)
-Remove vector of NotificationView objects which isn't needed
-Get source application info from notification object, not the received
message which is not reliable
Only using the keyboard navigation colour to indicate the current day isn't that
nice in all situations. When using custom system colours, like white on blue
for selected items, it can become barely readable.
Now we
* use bold type face for 'today',
* tint 'today's background (lighten for dark, darken for bright bgColor),
* use B_LIST_SELECTED_BACKGROUND_COLOR and B_LIST_SELECTED_ITEM_TEXT_COLOR
for the selected day,
* keyboard navigation colour only for the frame and text when doing keyboard
navigation
Fixes#13714
* Use BDateFormat::GetDayName() to fetch weekday names.
* Use appropriate symbol width(Mon, Mo, M) depending on the frame width.
* Provide functionality to update day name header in case of locale
preferences change.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
It can give results such as "in 2 hours", "2 days ago", etc.
This is different from BDurationFormat which will just say "1 hour, 2
minute and 36 seconds"
When using BAffineTransform, the update rect is not in the same
coordinate space as the drawing rectangle. Hence, testing them for
intersection does not work, and leads to not drawing buttons which are
in fact visible.
Moreover, the code in BControlLook does not perform only drawing, it is
also expected to update the drawing rect, so other functions may reuse
it later (for example, drawing a button border also computes the
rectangle for the button background). Because of this, it is not
possible to skip the drawing completely, or we could break the layout of
the client.
Fixes#13664