Commit Graph
100 Commits
Author SHA1 Message Date
John Scipione 844099afc1 Expander: Add bottom spacing back in
Change-Id: I8672079196a370e0e4ec817771977372c30cda6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8687
Reviewed-by: waddlesplash <[email protected]>
2024-12-18 04:24:26 +00:00
John Scipione b230e1d06b Tracker: Fix regression from hrev58264
From Code simplifications a4a5800e5f

In file panel switching dirs using the menu field got broken.

Change-Id: I2e9d75ba62082be27a85dbfa12e30a324f9fb440
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8501
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-10-23 04:46:50 +00:00
John Scipione 616d1868a6 Tracker: Open parent of Desktop window but not Desktop
Tracker: Fix crash switching browser/spatial mode.
from a4a5800e5f
from b6eb4ec4ab

Change-Id: Ifdb7f64e2308189969718d62525a274bcdb53e38
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8470
Reviewed-by: waddlesplash <[email protected]>
2024-10-19 05:06:08 +00:00
John Scipione f2dca4f0f6 Tracker: Bail out before cleanup if popup window is already open
Fixes crashes & irregularities when context-clicking repeatedly,
especially on Desktop.

Remove RepopulateMenus() context-clicking on Desktop introduced
in hrev44673.

Fixes #15890

Change-Id: I373d78e4fd0533d248c6cfd4291f6f69f212a6c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8374
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-10-19 03:51:49 +00:00
John Scipione 77fafacae3 Tracker: Cleanup menu items better in DeleteSubmenu()
Change-Id: Ie0679393c208e8dcaf23f975ba3d9bd2d12bad12
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8228
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-10-19 03:51:49 +00:00
John Scipione 84bdf57a71 Tracker: Record count to determine no. of templates to add
Change-Id: If83ee2c79829a57a645d4f7e831bf88d40267cfb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8227
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-10-19 03:51:49 +00:00
John Scipione b6eb4ec4ab Tracker: Close duplicate windows switching back to spatial mode
Change-Id: Ib48b0b88651ced131d4e3081215792878b5ba837
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8370
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-10-19 03:51:49 +00:00
John Scipione a4a5800e5f Tracker: Code simplifications
BPoseView no longer keeps directory type state on switch directory.
BContainerWindow gets the state from the pose view on demand instead.

Rename IsDesktopWindow() to IsDesktop() which has the same meaning as
everywhere else: the Desktop but not the one in a regular window.
Store this information in the fIsDesktop parameter in pose view and
set it one time on PoseView::AttachedToWindow().

Consolidate ParentIsRoot() logic into method and call it.

BContainerWindow updates:
* Remove isDeskWindow param from constructor, only usesLayout now.

Prefer Selection version inside Tracker, e.g. kDeleteSelection

Change-Id: Ib114585a235931e96cbdcc0de6d7b8f6e9bc20c3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8226
Reviewed-by: waddlesplash <[email protected]>
2024-10-19 03:51:49 +00:00
John Scipione 406f30c616 Tracker: Commands.h (and tracker_private.h) updates
* Add kDeleteSelection command alias in Commands.h, keep kDelete.
* Add kMoveSelectionToTrash and use it in place of kMoveToTrash.
  - kMoveToTrash in kept in tracker_private.h for use outside.
* Create a new constant kRestoreSelectionFromTrash for Tracker.
  - Move kRestoreFromTrash to tracker_private.h

Change-Id: I3cdefe97e8359fb53bacfc3319b046b051c6f7db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8225
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-10-17 16:21:51 +00:00
John Scipione 8f97570f6a Tracker: Style changes related to Shortcuts update
Change-Id: I30d10821a2767c77718f8545b585ef577b546405
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8224
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-10-17 16:21:51 +00:00
John Scipione 2a9f66d232 Tracker: Do not prompt user if drag from query
Fixes #9971

Change-Id: I6a4fe23d847ef36de4e1afe04eac0ccb185ba886
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8375
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-30 15:59:59 +00:00
John Scipione 73b4c7a698 HaikuDepot: Prevent crash when hovering over or clicking on conditions
... before the text is loaded by checking that the text document is set.

Remove fMouseDown member and MouseUp() override.
Get mouse button down from the current window message.

Call inherited BView methods.

Fixes #19077

Change-Id: I79edb1860e3bd7864d2362d7f59fb3a583d19053
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8260
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-09 16:26:01 +00:00
John Scipione f657ee8e46 WebPositive: Small corrections to hrev58090
Add missing break statement (and remove curly brackets).
Use FindColor instead of GetColor, no default color on failure.

Change-Id: Ic868a82ec653226a4fbdec57b5fa7d3f58b2bf27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8244
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2024-09-09 08:40:01 +00:00
John Scipione 3cbff9d884 BButton: Tint button background color lighter on dark
Change-Id: I216961e435b0ab5d086fdf26baf69b154b5cba07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8236
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-05 17:45:01 +00:00
John Scipione 42df4f9689 Interface Kit: Adopt parent colors on controls
BControl adopts parent colors on AttachedToWindow(). Use the
adopted view and high colors for BControl derivatives before
using B_CONTROL or B_PANEL colors.

Affects the following controls:
Spinners
Checkboxes
Radio buttons
Sliders
Text controls
Buttons (get control text color already, don't pass it in.)

Affects control colors in HaikuControlLook and BeControlLook,
FlatControlLook control colors derived from HaikuControlLook.

Do not remove control flag before drawing label, we get the
correct label color now. The fallback colors are only for if
you override AttachedToWindow() on your BControl subclass to
prevent adopting parent colors.

Change-Id: I9357c0287898bff48c695a7869f3b8be108c02ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8235
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-05 17:45:01 +00:00
John Scipione 5333610f85 Interface Kit: Adopt parent colors on checkboxes and radio buttons
We do not always use radio buttons and check boxes on panel color,
use the parent colors instead if you have them. The label is left-
center aligned.

Change-Id: Id5cbd98e8ae88d3a65fb0735d45b2ad19c4afdf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8233
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-05 15:19:09 +00:00
John Scipione 325c28a8ae package_daemon: Use document colors on problem and results window
... instead of list view background and panel text foreground.

Document color is appropriate here, this is not a list and we
don't want panel colors. Document color yields same result
as list color using default colors: black on white.

This changes the colors of the inside of the dialog that says:
"The following additional package changes have been made:" and
"The following problems have been encountered. Please select a
solution for each:"

fixes #19068

Change-Id: I5b721ad8703c73aa2da323eb189fa22033d44e5a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8232
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-09-05 15:19:09 +00:00
John Scipione 6cb94b77be package_daemon: Style fixes (100 char) related to status window colors
Change-Id: Icf8d43f6fb464adc967437b96f26eb98b3df8572
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8231
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-05 15:19:09 +00:00
John Scipione 7e6bc7ce71 Deskbar & Tracker: Use menu font where appropriate
i.e. not on Deskbar team menu, menu field menus or the clock
options menu but all regular menus at the top of the window
and other context-click menus.

Change-Id: If551aecd040500973a92fda2138b6ffe03cda279
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8154
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2024-09-02 21:18:03 +00:00
John Scipione c9ce7be28c AbstractSpinner: live update text color when enabled
... whatever motivated this to only work on disabled text views
has been resolved.

Change-Id: I3ae9d056870f1163d3fa074ab9a1dad96c0192f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8168
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-01 22:55:30 +00:00
John Scipione 4d5c2f8da2 Tracker: BView => _inherited in Find window AttachedToWindow()
Does the same thing but _inherited is used so we can change the class.

Change-Id: I6c0bf7b35917da55a3bd4aa15b5bb80063f2b02a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8150
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-01 02:22:44 +00:00
John Scipione 3399bac1b2 Tracker: Fix pose UpdateIcon() list mode top
We don't need to set the top here, it is already set by CalcRect()
a couple lines up. Our calculation was slightly off causing bug.

Fixes #12558

Change-Id: I022cc661cf55a9d016fd722c701f05fc1f9fea4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8165
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-31 17:04:45 +00:00
John Scipione fc07afd4bc Create symbolic link when drag and dropping files from a virtual folder
... instead of making a copy like normal. This changes the default
behavior, you may override it by context-click dragging and selecting
Copy or holding the option key to force copy.

Implements #18729

Change-Id: Ib13bec347f300d25de77064ced79693ecbc3a85c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8144
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-29 16:46:02 +00:00
John Scipione 7616fbf28d Tracker: Change On => Target: before volume field in Find window
Change-Id: Ie1725007d1534736b7252024bfb0b1cbcc3c446a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8146
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-08-29 15:52:11 +00:00
John Scipione 6fd95ed760 Tracker: Fix "Find" window menu field truncating
Minimum menu field width is set by "multiple selections" string width
on volumes menu field or a smaller size that matches R1B4 on rest.
Maximum menu field width chosen to match current based on font size.

Set the max content width to truncate long mime-type names that don't
fit. Add room for the pop-up indicator.

Create member variables to hold menu fields. Resize the menu fields in
AttachedToWindow() after they have been marked because the width
depends on the marked item.

Set member pointers to NULL in constructor where not already set.
ASSERT variables we use are not NULL, they aren't but check anyway.

Use DefaultLabelSpacing() for the spacing between icon and text to make
them font sensitive. DefaultLabelSpacing() is 5px at 12pt font matching
current.

Fixes #18999

Change-Id: I0e52b5aa557c8b5d76f09e0b60fcb965e3ff65e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8143
Reviewed-by: waddlesplash <[email protected]>
2024-08-29 15:52:11 +00:00
John Scipione af440edade Tracker: Put On back before volume field in Find window
Change-Id: Id1138bd9e79b37e30df4c8079f0b0e8cbe3c4d03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8145
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-29 15:52:11 +00:00
John Scipione 6d94fbc3cf Tracker: Style changes related to Find window
Change-Id: I78f416276f9e7357ddb18c91450c16a6f5abd37f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8147
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-29 15:52:11 +00:00
John Scipione fe514848c2 Tracker: Change kMoveSelectionTo to kCopySelectionTo on paste
This restores cut items state to full opacity on paste.

Reverts the part of hrev53329 for cut items. We only copy duplicates
on copy operations, not cut, but we have to make all cut operations
copy after paste is over to restore the state. The clipboard mode is
altered but not the contents.

Fixes #15267

Change-Id: I8a036a548719fe49c512bd38ff1a072890ab2325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8100
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-08-26 18:21:32 +00:00
John Scipione b93d08f989 Tracker: Make updateMessage a stack variable and style fixes
... related to fixing paste bug.

Change-Id: Iea500729d270f2a222244d38b9bf7a2917186f16
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8099
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-26 18:21:32 +00:00
John Scipione d26613e1bb Keymap: Restore menu field status icons
Fixes the missing piece of hrev57496
"Keymap: Put status icons inside menu fields"

Change-Id: I824f8c105036ae7ea6535f33e0ec0fa8f812f39d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8112
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-26 17:14:45 +00:00
John Scipione 9d4d102df2 Tracker: Override Open with... pose view text color and back color
Make TextColor() and BackColor() virtual in BPoseView so that we can
override them in subclasses. These are used to invert colors on select.

Move InvertColor() and InvertedBackColor() to Utilities.

Move Desktop...() methods to DesktopPoseView overrides, this does the
same thing but in DesktopPoseView as an override.

Add override methods to Open with... pose view. Open with... window
text color were not updating with color settings making text unreadable
in dark mode. Open with... background and text colors update based on
tooltip colors which was chosen previously.

Change-Id: Id605f1887d6018766b09a6de372b6071de8b83ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8105
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-08-24 18:19:16 +00:00
John Scipione 764365384d Tracker: Do not alter selection on Copy and Cut or Copy more, Cut more.
Fixes #5585

Change-Id: I75ff282febb81854088d731b9e54120161377b60
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8090
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-08-23 15:14:55 +00:00
John Scipione 55e018dcb8 DefaultBuildProfiles: Increase nightly image size to 650MB
... up from 600MB because we need a bit more space for swap in the
live environment for 3d apps.

Fixes #18986

Change-Id: Ie8ba03c2fb65d02f1c26609d78101ee355d65630
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8085
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-21 17:17:57 +00:00
John Scipione a61df2290c Decorator: Redraw phantom tab
Add the area of the tab that just got removed from the stack
to the update (redraw) region so that it will be redrawn.

Fixes #16006, #18517

Change-Id: I5a26c353e2dd2e63f72440ddd0b522b52b02b2a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8046
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: X512 X512 <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-19 16:01:06 +00:00
John Scipione f361fefa3e ListView: Do not alter selection on mouse up if was dragging
Fixes #19001

Change-Id: I2e5956f4f4e48f1032e46e9b5bcd0cf03f1eb568
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8045
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
2024-08-19 16:00:39 +00:00
John Scipione 3fb85af36c Tracker: Enable/disable New Folder/Template menu on context-click.
(kWindowPopUpContext not kPosePopUpContext).

Fixes #18975 again on context-click

Change-Id: I4e3cf134f318e513c40aad42001257437aea70c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8039
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-15 16:17:49 +00:00
John Scipione 6edfc6e012 Tracker: Repopulate menus when entering/leaving volumes
Change-Id: Ifef64abb6ae2865d281b66fd2de7e2b7ba067ca6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8003
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-12 16:56:27 +00:00
John Scipione 8717bb87dd Tracker: Enable/disable New Folder/Templates on UpdateMenu()
Fixes #18975

Change-Id: Icbcf4bb95a999bdf7ce0afed2051c2d3cfb59971
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8002
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-12 16:56:27 +00:00
John Scipione de483e1765 Libpackage: Add HOST_LIBSUPC++ to libpackage and solver
(This is needed to cross-compile on macOS.)

Change-Id: I2b0186e2a9ac09fc332a43808d55fcb2d5ebc86b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7933
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-08-07 20:17:44 +00:00
John Scipione 26db1794f9 libprint: whitespace cleanup only
Change-Id: I5a3da12e8f61ff404a50b24b0962f9c92511b182
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7791
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-07-02 10:49:48 +00:00
John Scipione 8446d3b9b5 Tracker: Miscellaneous cleanup
Move DraggableContainerIcon out of ContainerWindow.cpp into new.
Move CompareLabels to Utilities.cpp

Rename fContainerWindowFlags to fOpenFlags. These are the flags set
by OpenContainerWindow to save and restore state and should not be
confused with the windowFlags that are passed to BWindow. There are
two sets of flags, which I'm calling openFlags and windowFlags.

Rename fUseLayouts to fUsesLayout and useLayouts to useLayout. Put
all the constructor created flags at the top.

"window" variable name is ok, we don't need to say "containerWindow".

Rename Addons to AddOns everywhere with a capital O.
Rename BuildAddOnMenu() to BuildAddOnsMenu() with an s.
Rename AttributeMenu...() methods to AttributesMenu...() with an s.
Rename SetUp...() methods to Setup...() with a lowercase u.

Replace a few instances of fPoseView with PoseView() inline in
BContainerWindow and BDeskWindow.

A few more minor fixes in BDeskWindow.

Replace BPoint(0, 0) with B_ORIGIN in Pose.h

Change-Id: If30803753b63b19e35f14c0f0c4e08111d0d0980
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7240
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-01-28 09:46:35 +00:00
John Scipione 90510b4af9 Tracker: Remove Trash settings remnants
PoseView.cpp changes
* Create DoDelete() and DoMoveToTrash() convenience methods in BPoseView.
- Call DoMoveToTrash() in B_DELETE handler checking Shift.

Tracker: Update Delete warning dialog

This dialog pops up when you Move to Trash with Shift held down.

The Skip Trash version has been deleted since we've decided to
no longer using this settings.

Push Cancel button over to right on the "Delete files" version.

Handle default case in switches so that a weird value is returned it
will Cancel. If BAlert receives B_QUIT_REQUESTED it returns -1 for
example according to the Haiku Book so make sure to handle this case.

Add B_CLOSE_ON_ESCAPE flag and handle that case.

Change-Id: I16c532bfef585081207f1df3edc93f69dec6e529
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7199
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-01-28 09:46:35 +00:00
John Scipione 4fc18643b9 Keymap: Put status icons inside menu fields
Draw warning and stop icons on top of the menu fields instead.
Remove conflict views, create a new file to hold StatusMenuField
and StatusMenuItem. Set the icon with them instead.

Change-Id: If6c00199f24ac4f4fc789f12cc6cdcd7a912418f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7209
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-03 03:26:27 +00:00
John Scipione f99596f4e3 Icon-O-Matic: Fix crashes while auto-scrolling
This fixes crashes that happen when scrolling list views in Icon-O-Matic
triggered by the BListView auto-scroll feature reintroduced in hrev57439.

Take out the auto-scrolling code from Icon-O-Matic, call BListView's
MouseMoved() instead since BListView's can scroll now. The BListView auto-
scroll feature has been updated to work with draggable multi-select.

ScrollTo(index) method has been moved from Icon-O-matic to BListView and
is used to scroll to an index instead of a selection since the selection
doesn't change while you are dragging.

Override BListItem's DrawItem() method to prevent it from drawing. I've
hijacked DrawItem()'s complete param to mean even or odd instead.

Everybody draws the same background PathListView.cpp and StyleListView.cpp
now push the frame over and draw text using SimpleListView parent class
DrawItem() instead of repeating the drawing code.

InitiateDrag got moved from the abstract DragSortableListView class to the
SimpleListView implementation class.

The following color constants have been added:
rgb_color kDropIndicatorColor = make_color(255, 65, 54, 255);
rgb_color kDragFrameColor = make_color(17, 17, 17, 255);

First one is the red drop target indicator line. It has been changed to
clrs.cc red which is the same as B_FAILURE_COLOR, but I didn't want to use
that InterfaceDef constant as it doesn't indicate failure in this case,
it's just a slightly different red.

Second one is the drag selection outline, it has been changed from pure
black to clrs.cc black which is a shade lighter than pure black.

Fixes #18707

Change-Id: Ib0b375d7d5641d458a6ce004a6dfeac551636698
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7215
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-03 03:24:13 +00:00
John Scipione be84a3d6e4 Icon-O-Matic: Minor changes and style fixes to list views
Not 100% style changes but the functional changes are very minor.
This is to create a clean base on which to make my other changes.

Remove commented out code. Remove LIB_LAYOUT.

Replace calls to _SetDropAnticipationRect with assignment to fDropRect,
make all methods protected. Rename _SetDropAnticipationRect to
InvalidateDropRect and remove _'s from methods.

Some extra NULL checks are included in ShapeListView and it has been
de-indented.

omit .0 where it doesn't matter.
rename r to rect
tab style on classes
use SetHighUIColor/SetLowUIColor where appropriate

Change-Id: Ife514452dc6ea5d5cd75ccba2fd13d46d69bcffc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7214
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-30 18:25:57 +00:00
John Scipione 879e5f5a80 BListView: More auto-scroll fixes from hrev57439
Only auto-scroll if button clicked inside view, not if clicked outside
and then dragged in. Save MouseDown() button state to compare against
in MouseMoved().

Don't alter selection on first click of selected item on multi-select
lists. This eats a click on multi-select lists when you click on a
selected item with no modifiers held down to allow for drag and drop.
It will update the selection on the second click (and there-after).

https://www.haiku-os.org/legacy-docs/bebook/BListView.html InitiateDrag()

"... derived classes typically permit users to drag items only if
they're already selected (if wasSelected is true). In other words, it
takes *two* mouse-down events to drag an item—one to select it and one
to begin dragging it." (emphasis mine)

Technically this should only happen on draggable multi-select lists, but
it doesn't hurt (much) on non-draggable multi-select lists and I can't
easily tell if a list view is draggable or not until InitiateDrag() is
called. By then it's too late to eat the click in MouseDown().

BeOS R5 solved this problem by selecting on mouse up insted of down but
we don't want to do this so we'll just have to accept that the first
click in this case doesn't count.

Simplify invalid and disabled item logic. If clicked on invalid
(somehow) don't alter selection, if clicked on disabled deselect all.

Change-Id: I6bf40de85da442ee7acd86ab6d91ff0cac7ab106
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7279
Reviewed-by: waddlesplash <[email protected]>
2023-12-30 18:25:57 +00:00
John Scipione fd2a5629f1 BListView: Contain scroll within scroll area horizontally
... but extending vertically above and below the list view.

https://www.haiku-os.org/legacy-docs/bebook/BListView_Overview.html

"BListView provides an autoscroll feature: There's an invisible area
about 25 pixels high both above and below the list view; if the user
clicks inside the list view and then drags into this autoscroll area,
the contents of the list will scroll in the direction of the mouse."

Instead of 25px scroll vertically without limit because scrolling
speeds up as you move the mouse cursor further away.

Change-Id: I52296beb2b0173fc5c909255163e8725e99c2b6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7244
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-29 14:23:17 +00:00
John Scipione 488ab9b45f BListView: Fix crashes on MouseUp in Genio and Icon-O-Matic
... and others and double check for valid items on MouseMoved().

Bail out if drag item is invalid instead of deselecting.
Make sure that the item is valid before deselecting it.

Fixes #18707 #18716

Change-Id: Ic115f713f2aef7dfebafd23bc3107106b9128b8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7243
Reviewed-by: waddlesplash <[email protected]>
2023-12-27 21:14:28 +00:00
John Scipione 6307bc5739 Tracker: Refactor Default settings to be in one place
Create TrackerDefaults.h to share default setting values between
TrackerSettings.cpp and SettingsView.cpp instead of duplicating
the default value in both places.

There is now one source of truth if we ever want to change a
setting it won't cause regressions to the Defaults and Revert
button state.

TODO Does not yet include Disk auto-mount settings.

Add HideDotFiles to the defaultable list for Windows settings
and make its default false (was true in some places).

Fix issues with the Defaults button not enabling Enable type-
ahead filtering and Generate image thumbnails as it should.

Move default color constants to TrackerDefaults.h, remove TODO.
Rename kSpaceBarAlpha to kDefaultSpaceBarAlpha matching rest.
Create RGBTOHEX(c) macro to convert rgb_color to a (hex) number
for HexScalarValue to set the default space bar colors.

Saving these old hex values in the commit message:
UsedSpaceColor: 0xc000cb00
FreeSpaceColor: 0xc0ffffff
WarningSpaceColor: 0xc0cb0000

Reorder setting to match display order.

I've gone way over 80 in TrackerSettings and SettingsViews due
to long variable names.

Change-Id: Iafd6dfc5e738562d73967558e1f151fc7fed5866
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7196
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-24 13:23:34 +00:00
John Scipione 0b3890fea1 Keymap: Fix Modifier Keys window regressions from hrev57267
Fix _DuplicateKeys() conflict check for Caps Lock to ignore right side.
- Create kUnset constant set to 0 so it's clear what's going on.
- Create kDisabled constant set to -1 for that case.
- Declare loop variables one time out of loop scope, uint => int for -1.

Fix _MarkMenuItem() warnings icon check. We should get a yellow warning
icon if your left and right modifiers don't match (except on Caps Lock).

Create an _UpdateStatus() method that calls the other methods we need.

Reverse the placement of the Revert and Cancel buttons. Cancel goes just
to the left of the OK button and Revert goes all the way left.

Restore _HideShowStatusIcons(), this is used to push the menu fields
over when there is no conflict. _ToggleStatusIcon() convenience method.

The key role is called "Caps Lock" not just Caps. Method and variable
names are fine, but the " Lock" part is important in the label. Also use
"Caps Lock key" instead of just "Caps Lock" for the menu field value.
We use " key" at the end for the other cases to differentiate them from
the role label.

Minor nitpicks:
- Change comment variable name to label. I understand that it says
  B_TRANSLATE_COMMENT, but it's a label, the comment is for i18n.
- Fix same method declaration style, and in header.
- Add 2 new lines after pragma instead of 1

Change-Id: I194e69486310a249d0ef2d5d5977ae69954e9a27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7179
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-24 02:47:06 +00:00
John Scipione 82bfaa954d BListView: Add ScrollTo(index) method, auto-scroll on drag
Multi-select lists may also auto-scroll on drag now as well.

Document ScrollTo(index). Give Scrolling its own section.

Change-Id: I36284a28376a01bafd23ddb30162fc786fb41521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7213
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-24 02:45:59 +00:00
John Scipione 9d660c7738 AboutSystem: "Show replicants" hide border fixup
Change-Id: I5926bbacae54238f2e399e28ae0ccbc7841e7c1a
2023-12-11 15:52:00 -05:00
John Scipione fc786a2f07 AboutSystem: Hide border when "Show replicants" is turned off
Create SysInfoDragger class and override its MessageReceived() method
to redraw the target view when draggers are shown or hidden.

Check that fDragger->AreDraggersDrawn() is turned on before drawing
the border in the SysInfoView::Draw() method.

Change-Id: I8de1acafe52319ae0f4ed1d91eec2e9c0ad2cb9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7191
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-11 18:20:04 +00:00
John Scipione 1395769e97 AboutSystem: Fix up layout issues with old replicants
... you have lying around on your Desktop that did not get updated
correctly based on changes that have been made since the replicant
feature was introduced.

Do not archive class members in Archive(). Remove SysInfoView
archive constructor. Recreate replicants fresh. No saving to lists
and restoring.

Maintain bottom right corner whenever replicant is resized by
creating _ResizeBy() and _ResizeTo() methods. Since we're starting
over with replicants, this only happens when the uptime wraps.

Fix box height issues, was a bit too tall.

Change-Id: I464fc09a6f86bc88dc09007c9356d2faac340e77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7189
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-11 18:20:04 +00:00
John Scipione e26329ce22 BTextView: Prevent scrolling if text rect is inside view rect
No horizontal (or vertical) scrolling allowed if the text rect is
inside the view rect in x (or y).

This fixes issues with right-aligned text views getting scrolled
within bounds becoming left-aligned text views. Prevent scrolling
so that this cannot happen unless text is outside the view.

You can still get DeskCalc to be in a scrolled over no-longer-
right-aligned state by scrolling and resizing repeatedly, but
it's better than before and it is at least fixable. This is most
likely a bug in DeskCalc.

This also fixes issues not being able to scroll all the way right
after scrolling left dragging with the mouse.

Do not set any limits in _PerformAutoScroll(), all limits are set
by the code that does the keyboard handling. Set x and y and call
_ScrollBy();

Update limits set in _ScrollBy() to accommodate both keyboard
and mouse (taking from mouse and using on keyboard as well).
This unifies keyboard and mouse scroll limits in x and y.

Change-Id: I0dd24ce03f9b95651bcee4e190564b77f0343863
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7161
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2023-12-10 09:44:58 +00:00
John Scipione 0e673505eb Keymap: Capitalize L in Caps Lock as a proper noun
... exception to sentence case rule, also Scroll Lock and Num Lock.

Capitalize Right/Left Shift, Control, Option and Command as well.

Change-Id: I65b85eb580fe8cd06664b1bc230ac6aef15d6487
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7182
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-10 04:20:43 +00:00
John Scipione 64a2e73375 Add _ViewWidth(), _ViewHeight(), _TextWidth(), _TextHeight()
private convenience methods to calculate the text view width and
height with insets and the text rect width and height without
insets respectively.

Also add _ViewRect() and _TextRect() methods for completeness,
but they are not currently used.

Change-Id: I0582bc93a0a3a6820bbb2262a1d726457309ab9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7162
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-08 10:14:14 +00:00
John Scipione 89b4e5d23e BMenuItem: Add B_BACKSPACE and B_DELETE UTF-8 shortcut chars
U+232B Erase To The Left
U+2326 Erase To The Right

Special case B_DELETE so we don't have to fill out kUTF8ControlMap
with NULLs to get to the last char of the ASCII table at 0x7f.

Lowercase the A in the B_SPACE hex string matching other cases.

Change-Id: Ia5d793112ae8063dfe58366c9dd10d6e616af350
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7177
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-07 10:47:52 +00:00
John Scipione f66a7eb59e Tracker: Fix Default button in settings for thumbs default on
Change-Id: I3d7398cb19a34d78a12c4a1fc325f2d15d59e825
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7180
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-06 18:07:07 +00:00
John Scipione d8f0eb354e DataTranslations: Call parent list view MouseMoved
... in this version's MouseMoved() to draw selection while dragging.

Related style update to MouseMoved in header (dragMessage, 80 char).

Change-Id: I7b6396ca9dd9b7868894a6424c02ba3ee4e6b20e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7175
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-05 22:10:10 +00:00
John Scipione 6761bf581f BListView: Update selection on mouse down and mouse up
A version of this feature was originally implemented in hrev50495
that allowed you to scroll through a list of list items while the
mouse was held down updating the selection as you went.

This feature was removed when we switched to selecting on mouse up
in hrev52062 and was never reimplimented when we switched back to
selecting on mouse down in hrev52121.

In BeOS R5 as you scrolled through a single-selection list with the
mouse button held down the selected item appeared to change, but
the selection didn't actually update until you released the mouse
button. The selection never changes on mouse down, only on mouse
up. You could click on one item then move your mouse off the first
item to a second item releasing your mouse button and it would
select the second item without ever selecting the first item.

In this commit we replicate this behavior with one exception, we
always select on mouse down, but still allow the selection to
change on mouse up.

The big difference between this and the BeOS behavior is that on
BeOS you could only select exactly one item on mouse up, while with
this you can select one item on mouse down and a second item on
mouse up.

ScrollToSelection() in MouseMoved() if mouse button is down and
we are not not dragging. This performs auto-scroll.

Create private _DoSelection() method copied from MouseDown().
Remove Thread.h include that is no longer used.

Fixes #15009 (and doesn't cause regression for #9190 #14264 #14289)

Change-Id: Icae02b8d37ed281390647504b4efa3d694ea522a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1956
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-05 22:10:10 +00:00
John Scipione c70de894ea Tracker: Another minor code simplification
Replace string literal with kMakeActivePrinter command, shorter.

Change-Id: I64b552fb49fd34f07d956ed6f8a740d7c84a3f7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7173
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-05 20:33:01 +00:00
John Scipione 9bc1ff61eb Tracker: Allow Get info without selection in File menu
If you don't have a selection, Get info on the window instead.

Change-Id: I83db030798788a487ce3123bb8b2c25056d4fbf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7170
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-05 16:51:01 +00:00
John Scipione 0509d19b91 BTextView: Stylish fix, -x is clear we don't need -1 * x
Change-Id: I38a5e6c88e2ba3b2f82c49aa760942e1799a7595
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7171
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-05 16:50:27 +00:00
John Scipione 6a0798da0c Tracker: Show "-" for packagefs volume size
... instead of "4096 bytes" (i.e. 1 block).

Set total_blocks to 0 in packagefs_read_fs_info to indicate
that the capacity is 0, this avoids some potential issues
that using 1 or -1 might cause.

In WidgetAttributeText look for volumes with 0 blocks and
set fValueIsDefined to false which displays a "-".

Also replace capacity string with "-" in Get info.

Fixes #10291 the quick and dirty solution to #18567.

Change-Id: I7ff204c9ffd10cf9cc6343fcdd4422c034004004
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7164
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2023-12-02 19:29:08 +00:00
John Scipione 6f451a737b Tracker: Minor code simplifications
Call TargetModel() instead of PoseView()->TargetModel(), shorter

Eliminate duplicate method in FSUtils. Call FSIsRootDir() in a
couple of places instead of looking for "/".

Change-Id: I42b7f39e7708eda107ee479a6cd36cb58ac77ad9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7172
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-12-02 03:33:40 +00:00
John Scipione 41fcdb3c1c Tracker: Remove stray separator
... when context-click on a volume in Open/Save dialog.

Regresssion introduced in hrev56978. Separator goes with the
Paste item that is not currently added.

Change-Id: Ic9402cae27ed84f15479ee9b9cc1f48fea806efa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7169
Reviewed-by: John Scipione <[email protected]>
2023-12-01 22:03:21 +00:00
John Scipione 0d85e8fb10 AboutSystem: Consolidate info, remove inaccessible memory
Change-Id: I0a5c0cb61f8c2b01caf12a907ad1c7938c519cf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7152
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-11-30 20:27:10 +00:00
John Scipione 5a66a92969 BColorControl: right-align text box values
Change-Id: I2ead9d310d265c04b49ea3029694584e628d782f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7160
Reviewed-by: waddlesplash <[email protected]>
2023-11-28 22:33:03 +00:00
John Scipione ba4ed24acc Tracker: Replace Path with Location in Query
... matching what's in the Attributes menu and everywhere else.
Right align Size column. Replace attribute literals with constants.

Change-Id: I336ef03cd500bf0e079435e21e5b8bf704d29aac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7157
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-11-27 17:18:38 +00:00
John Scipione e91af56d9f BMenu: Turn on keyboard tracking on up arrow too
Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.

Fixes #18686

Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <[email protected]>
2023-11-24 23:04:09 +00:00
John Scipione ac83e7f073 Tracker: Fix CanEditName() crash (from hrev57402)
Although I can't reproduce this crash, from the looks of the crash
report something in the CanEditName() method is throwing a
segmentation fault.

If selection count is not 1, don't even try to get the selection,
Edit name is not allowed unless you have a single item selected.
Double check that selected item is not NULL before using it.

I refuse to believe that fSelectionList being NULL is the problem
here, more likely fSelectionList->FirstItem() is NULL and is the
cause of the crash. Bailing out after checking that selection
count is 1 should ensure that FirstItem() is not NULL.

Hopefully fixes #18684

Change-Id: Ib99192178fa6f6d31b389afb47e72c5513e6e1c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7139
Reviewed-by: waddlesplash <[email protected]>
2023-11-24 18:52:13 +00:00
John Scipione f5029bd569 Tracker: Disallow Restore from Trash if no selection
TargetVolumeIsReadOnly() doesn't make sense here because we
know the trash's volume is not read-only, we need to check
that you have a selection to enable Restore. Currently
(since hrev56978) Restore option is always enabled but it
shouldn't be if you have nothing selected.

It would be nice to also check if the restored location is
not read-only because you put something in the Trash then
remounted the volume read-only, but that's too much work.

Fixes yet another regression from hrev56978.

Also missed a delete convenience method call in hrev57402.

Call CanMoveToTrashOrDuplicate() to check if delete is allowed.
This method does a bit more work, it checks if the selection
includes the Desktop, the root volume, or the trash itself
which you are not allowed to delete.

Otherwise the same, this shouldn't make a big difference.

Change-Id: Ie188f25bd969a5aaeec9ff397fa5750872ccf97f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7138
Reviewed-by: waddlesplash <[email protected]>
2023-11-24 18:52:13 +00:00
John Scipione 32d1cd8e82 Tracker: Fix regression Copy To writable volumes
Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.

This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.

Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.

Fixes #18657

Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <[email protected]>
2023-11-24 16:34:37 +00:00
John Scipione cf83394d00 Tracker: Put duplicate checks into convenience methods
... and a few minor feature updates.

Create a CanEditName method on PoseView because we were using
subtly different checks in different places to see if allowed
to edit the name or not.

Tint background color of the Edit name text box on read-only
to indicate that the file name cannot be edited (only copied).

Create ReadOnlyTint() method in Utilities and use it here and
in PoseView to set the background color. Eliminate BackTint()
method from PoseView which served a similar purpose.

Add CanMoveToTrashOrDuplicate() convenience method.
Move To Trash, Delete and Duplicate options use same check.

Context menu of selection in file panel gets Duplicate option,
window context menu never did so don't try to enable it there.

Change-Id: I7a82d00ea10f22a7885c2e898a809e1abe9a6b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7122
Reviewed-by: waddlesplash <[email protected]>
2023-11-23 18:15:48 +00:00
John Scipione 501aa0f311 Tracker: Check selection parent is read-only on query
If 0 items are selected, check the window's volume instead.

If 1 item is selected, check if the parent's volume is read-only.

If multiple items are selected, consider the entire selection to
be read-only if any item's parent directory in the selection is
on a read-only volume.

You aren't allowed to for example Cut a selection that has an
item on a read-only volume as the Cut operation would not be able
to succeed. However, if all items in the selection are not on a
read-only volume then you may Cut.

For non-query windows assume all selected item's are on the same
volume and only check the first item when multiple are selected.

Fixes #18661

Change-Id: Ib898e54b62558c66aad65d33afd080480e312565
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7120
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2023-11-23 18:15:48 +00:00
John Scipione f9693a1300 Deskbar: Set tooltip on truncated window items
Fixes #18678

Change-Id: I91eeb19a77e400cf798fe23cc6d50565926063d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7121
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-11-22 16:07:14 +00:00
John Scipione ac121994b1 Deskbar: Set sub-menus to menu font
Top level "menu" still uses be_plain_font, submenus use menu font.
Window submenus use menu font, but in super-expando mode they use
the plain font since they are on top level.

Change-Id: I704e9baa1ec46d1cbf7b9401ba4e49b5e2dff27c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7041
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-18 08:25:01 +00:00
John Scipione fb1d071e14 Deskbar: Increase Twitcher team icon size from 32 to 48
Change-Id: Id9029295314f0d52df2f4a71a2ce3142f46a0947
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6414
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-20 15:08:20 +00:00
John Scipione a656120f1f Deskbar: Center Twitcher window 1/16 screen height above center line
Change-Id: Ia829f9077afc0a12cb34d12b1cd8eccea2bba741
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6413
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-20 15:08:20 +00:00
John Scipione fb885767b6 Deskbar: Use hvif window icons & scale with font
Add vector rdefs for shown, hidden, shown switch
and hidden switch icons. Remove unused bitmap
resources. Add window switch vector icons to
artwork.

Create window icon cache in TBarApp and cache the
window icons based on font size.
Fixes memory leak in #18357.

Don't draw off-workspace lines in Switcher, use
switch icon for that instead. Fixes crash reported
in #18359. Position icon and window name better in
Switcher.

Put BarTeamInfo icon parameter last and make it
optional, the icon gets set by caching.

Enable team icon cache and window icon cache.

Fixes #14694

Deskbar: Scale Twitcher icons based on font size

Remove the point ctor parameter and deprecate the
switcherLoc setting by not using or setting it and
leaving it at its default value.

Center window on screen resolution change and
workspace change (as resolution may not match).

Fixes #17924

Change-Id: Ib63cc307f14cda397ffb66ea74091be59e6e5535
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6335
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-20 15:08:20 +00:00
John Scipione 2b6ccde030 Tracker: Disable edit menu items on ro volumes
... such as virtual directories or read-only media.
Also applies to open/save panels.

Menu items disabled on read-only volumes:
* New >
* Duplicate
* Move to Trash
* Move To >
* Cut
* Paste

Other reasons a menu item is disabled:
* Duplicate, Move To Trash, Cut, Copy, Move to >,
  Copy to >, Create link > and Identify require a
  selection.
* Paste requires something in your clipboard.
* Edit name requires a single item is selected.

Edit name is permitted on a read-only volume so
that you may copy the name. However the name is
not editable, you may only select and copy.

Pop system folder warning dialog on Edit name
commit instead, this way you won't see the dialog
if you just want to copy the name.

Move "Create link here" option last in the right-
click drag menu. Disable "Move here" if source or
dest is read-only, rest if dest is read-only.

Ignore Paste to virtual directory, (even more)
but permit Edit name.

Allow drag-and-drop to virtual directory but alert
and disable all right-click drag menu items like
other read-only directories.

Tint window backgrounds on all read-only windows
darker, not just on virtual and query folders.
Automatically switch the background color as you
navigate in and out of read-only folders.

Fix highlight color on column resize when background
color is not white. Fix "reverse video" effect so
that the highlight color is the inverse of the
background color. On Desktop however, highlight
color is always black or white.

Do not alter focus in save dialogs after initial
focus on the file name because focus on the pose
view is required for cut/copy/paste to work.

Make Edit Name work in file open/save dialogs and
make Cut/Copy/Paste work while editing file name.

Make Select all work in Edit name.

Duplicate code cleanup:

NameAttributeText::CommitEditedTextFlavor() and
HeaderView::FinishEditingTitle() call common
EditModelName() function in FSUtils.

RealNameAttributeText inherits from
NameAttributeText and calls its inherited
CommitEditedTextFlavor() method.

The alert text is defined in just one place in
FSUtils ShouldEditRefName() instead of three.
Consequently file name changed in the info window
can now be undone.

Change-Id: I3a78960057b8fb42d1f71af2ec3c808754c9b314
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6357
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-05-09 16:09:34 +00:00
John Scipione 396f398d35 Deskbar: Fix horizontal mode window size limits
When your font size and team icon size is large
enough horizontal mode Deskbar gets cut off.

Compare composed to composed, this restores the icon
size scaling behavior as indended before compose
changes in Deskbar: label is positioned to the right
of the team icon until after the third icon size
notch regardless of your font size.

Change-Id: Ia1d1418cc3b04536a55860d3889d2437c40986cc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6415
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-08 16:18:26 +00:00
John Scipione 9da3977cfa Deskbar: Rename IconSize() to TeamIconSize()
Change-Id: Id536bacd60334cd167051a785e7fff819359aacf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6412
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-08 16:18:26 +00:00
John Scipione 69bbd7ad86 Deskbar: style fixes only
Change-Id: Ia5a94ded518a9b55aac94a69bcd393338bf90ebc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6411
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-08 16:18:26 +00:00
John Scipione cfbfb8473c BTextView: Allow nav on selectable but non-editable views
This allows arrow keys, page keys, home, end and the
blinking cursor on selectable views even if they are
non-editable. Input of text characters and backspace
are guarded on editable. Paste remains disabled.

Change-Id: Ifa5ed8673104e9abd51c52d394894aef48243965
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6407
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-05-06 16:39:58 +00:00
John Scipione d34f1c40e0 Tracker: Add BPoseView::CountSelected() method
Replace count variable with either selectCount
or poseCount depending on what is being counted.

Change-Id: I5e5caffd71bb932d93a822b28e73cdcfebff7135
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6399
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-03 07:31:42 +00:00
John Scipione b7dd18b22c Tracker: Style fixes only
... including whitespace, brackets, rename loc to where or
location, add a pragma.

Replace min_c with std::min.
Replace BPoint(0, 0) with B_ORIGIN
Use make_color() function to make static rgb_color objects.

Change-Id: I47a4e5e5f0e7038643baca7539d211350bbb8f20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6404
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2023-05-03 07:30:59 +00:00
John Scipione f18d2effbf API Docs: Update BVolume::SetName()
Update \since to BeOS R4. This method definitely predates Haiku,
it has existed since at least R4.5 despite not being documented.

Document B_NAME_TOO_LONG return value.

Change-Id: I0816e4e89ae2710f6123e10ee41145a83fdca66f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6363
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-01 14:21:41 +00:00
John Scipione fc12af740f netfs: Restore status_t result, fix build
result is being used on VisitReadQueryRequest().

It was not being used on ProcessQueryEvent() though
so leave that off still.

Change-Id: I8fbfbb3edef6ff962237f696fe315b66900b4376
2023-04-26 19:16:47 -04:00
John Scipione c7cd1bae68 BeControlLook: fix clipping rect, part of #12890
Change-Id: Ib3c29dd1ffba1f0456a5043b62d943123335e966
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6366
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-04-26 16:43:38 +00:00
John Scipione 26704b5974 Tracker: undo Model.h changes from previous commit
This changes more than just style, put enum values back.
In practice this makes no difference but the change was
unintentional so put it back like it was before.

Change-Id: I46c782c441d72e77a2897683f54ba7fcefbd5b63
2023-04-23 23:46:06 -04:00
John Scipione a63a67392b Tracker: Whitespace, alphabetize style fixes
No functional change intended.

Change-Id: Ib47f6b04e372923a5d2a1774ce4e3f56d8b05792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6370
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-04-24 02:47:43 +00:00
John Scipione 3e37877f10 BButton: Remove button label margins
... to prevent label truncation on BeControlLook,
BDH Calc, and some other places.

Fixes #16570

Change-Id: I68d8b64a631e116d3180c96be1fb5681de86fda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6310
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-04-12 15:17:34 +00:00
John Scipione 27b3dee8b3 Revert "Deskbar: Use hvif window icons & scale with font"
This reverts commit 2b65e2d808.
2023-04-11 14:19:11 -04:00
John Scipione 55d8d19ea9 BeControlLook: Implement DrawStatusBar
Fix drawing issue with DrawTextControlBorder().
Update text control border and status bar border colors
to match BeOS R5 better.

Fixes #17889

Change-Id: I3eeb9898b538456aec751f9b57d19b9910506325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6271
Tested-by: Automation <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-04-11 15:28:39 +00:00
John Scipione 4f97a431b9 Deskbar: Make Vulcan Death Grip work in mini-mode
Refactor so that ExpandoMenuBar and TeamMenu both call the menu item
TeamMenuItem::HandleMouseDown() method to do the actual work and then
send a message to cleanup.

Fixes #17761

Change-Id: I0e13e5fc6c90236936120ff0dda1246123576d37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6311
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-04-10 15:54:14 +00:00
John Scipione 2b65e2d808 Deskbar: Use hvif window icons & scale with font
Add rdef vector icons for shown, hidden, shown switch and
hidden switch. Reuse resource ids for vector icons. Remove
unused bitmap resources.

Fixes #17918.

Change-Id: I2ba1b126422f679c91f3272991c78d236198a358
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6260
Tested-by: Automation <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-04-09 04:50:56 +00:00
John Scipione 863bf67d8d Deskbar: Scale leaf/team menu with bold font only
Note that this only affects the leaf and team menu item icon size
as we do not actually display any bold text here and this does not
cause any menu text to display as bold anywhere in Deskbar.

The reason to use bold font is because the leaf/team menu is set
to the same height as the window tab and the window tab is bold.

Fixes #17913

Change-Id: I8fd23e30e9a28e6aa24b4726c73863b9d0370010
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6297
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Automation <[email protected]>
2023-04-04 18:39:40 +00:00
John Scipione 6781d35fcc Deskbar: Removed Utilities.h include from BarApp
There is no Utilities.h in Deskbar

Change-Id: If31a8eb0d36a62c9402c9d46e16891874e2d1aa2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6268
Tested-by: Commit checker robot <[email protected]>
Tested-by: Automation <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-04-04 18:38:30 +00:00