ViewState now always holds the unscaled icon size and PoseView
computes and caches the actual display icon size.
Anyone who used Tracker on HiDPI before this commit will likely need
to reduce the icon size on their desktops and any open windows.
Change-Id: I8689ea6baa408d07c715703e8f8bf8f29bf40f60
std::find() never returns NULL but the last element in case of failure
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5602
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* All MenuItem variants which draw icons now derive from IconMenuItem
and use its functions to draw and otherwise manage their icons. This
resolves a number of TODOs and reduces code duplication.
* Use BControlLook::ComposeIconSize() to compose icon sizes throughout.
* Remove unused methods from IconMenuItem.
"Shutting down" is too reminiscent of a system shutdown.
We're just quitting the app. Going with a generic "Cleaning up".
Correcting the app name, HaikuDepot.
Change-Id: Ifadf533170dc89befc971ea86b7140d3aa7fcef8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5605
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
If the new row is not in an open branch, it cannot possibly have
caused the focused row to have moved, and so we need neither check
nor perform an invalidation if that is the case.
This code has been this way since it was originally imported into
Vision's (!) CVS repository in 2001 from some Be sample code area,
and has not been substantially changed since it was imported into
Haiku's repository in 2004.
This saves quite a number of app_server round-trips and redraws
when importing lots of rows to the list, which fixes the other half
of the hang when changing functions in the call stack in Debugger.
This table will have thousands of items in every branch, most with
extremely long names, so resizing all its columns to the preferred size
takes an unbelievable number of app_server round-trips to measure text.
For modules with any significant usage of C++, there are going to be
functions with names so long that it will make the table quite
unwiedly to work with, anyway, when columns are automatically resized.
This fixes half of the whole-application hang that happens when changing
between functions in the call stack.
The buttons are now aligned to the scroll bar and window resize knob,
by using BControlLook::GetScrollBarWidth. (Hmm, perhaps it might make
more sense to just have scrollbar sizes be a kind of insets, which can
be gotten via B_USE_SCROLL_BAR_INSETS, and then drop this extra method
altogether? After all there are a lot of applications which align to
scroll bars...)
Resolve an issue with rendering package
icons when "Disable user addons" is
turned off.
Relates to #17862
Change-Id: Ic2d17626c40a97598613b8f21218d6829de97bbf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5556
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jacob Secunda <secundaja@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This was a holdover from BeOS, which did this as inline assembly.
We do not on any platform other than 32-bit x86, and even there
we may have preferred to do things a little differently on non-BeOS
ABIs.
Most things ported from other systems, or even native apps, are going to
use _Thread_local variables anyway, which will bypass this system
altogether.
* Get spacing from BControlLook.
* Initialize and place the buttons before the PoseView,
so that they can be used to constrain the PoseView's size.
* Update size limits based on spacing metrics.
Tested against filepanel command, Backgrounds preflet,
and WonderBrush. All seems to still work acceptably, and
now the controls are properly font-size-sensitive.
Fixes#13178.
Now that BAlerts can have custom buttons and change icons during
runtime, we need not maintain a custom "clone" of the BAlert logic
here in the registrar.
While at it, use ComposeIconSize to get larger icons on HiDPI.
This fixes#15704 as BAlerts already use the layout API,
while this logic did not.
Appearance remains the same at the standard decorator sizes (12pt fonts),
but this looks better on larger font sizes. Unfortunately it doesn't
scale quite correctly; the scrollbars in Tracker do not align with this
quite correctly. Probably the -0/-1 need to be adjusted based on the
window border sizes, but we don't have those metrics readily available
in this function. Yet another reason all these classes need a major
refactor...
This way, window metrics both from defaults and those stored and read
from settings will be scaled according to the font size.
This unfortunately adds to the code duplication in Save/RestoreWindowState,
but that code already seems somewhat duplicated and in need of a refactor
anyway.
* Instead of taking an icon_size, which we were having to cast
random integers to anyway, just take a BSize and convert internally
as needed. This simplifies a lot of usages of IconCache methods.
* Compute what B_MINI_ICON size will be at startup. This way,
we do not wind up caching "mini" icons in the fLarge*Icon variables
under HiDPI.
This does have a downside that if anything actually
does try to fetch "true mini" (16x16) icons when the real
ComposeIconSize(B_MINI_ICON) is larger than that, it will wind up
(confusingly) in fLarge*Icon, but that should not cause problems
and after this commit should not happen at all, anyway.
* Make mini-icon-mode use ComposeSize instead of the hardcoded 16x16,
and adjust metrics computations around it.
* Fetch larger icons in MountMenu logic. Also use BString::SetToFormat.
* Remove an unused, deprecated method from BPoseView.
* Rename variables in thumbnail generation code to match new behavior.
This reverts commit 50913d9a6f.
Reason for revert: this change broke the UEFI loader, see ticket #17880
Change-Id: Iefc0e53a09ddff94d7f0f2d4016af9119425af78
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5576
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This gets Deskbar looking somewhat more like its usual self in HiDPI
environments. There are still some hardcoded sizes which need to be
refactored, however.