Commit Graph
100 Commits
Author SHA1 Message Date
John Scipione 3e7a109936 fat: Change device_name to B_DEV_NAME_LENGTH bytes and use strlcpy().
Change-Id: Icd07bb4c23ce27d2f1361c66b1634c7f2be5d131
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9891
Reviewed-by: Oscar Lesta <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-01 08:36:35 +00:00
John Scipione 9d432d1b00 fs_info: Use B_DEV_NAME_LENGTH instead of 128 and remove TODO.
Change-Id: I2c93aee052ac4393512d457e1e84c969e5a927f9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10131
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-01 08:36:35 +00:00
John Scipione 08ce5659a4 Mail: Update text control colors automatically.
Remove SetStylable() call making it false.

Update low and high colors in _UpdateTextViewColors().

Update colors when B_COLORS_UPDATED message is received.

Change-Id: Iad3e3d9f46b922c7cf68e20cd7788d0d0efcb0b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10010
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-12-31 19:24:27 +00:00
John Scipione eb506aedcd Mail: Make read-only/disabled fields navigable and selectable
Always MakeSelectable(), MakeEditable() in SetEnabled().

Get rid of fEditable and fWindowActive. Get rid of IsEditable(),
SetEditable(), IsSelectable and SetSelectable().

Change-Id: Iab07097b2692ef6d9d7ed41b0fab45a2df99e261
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10009
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-31 19:24:27 +00:00
John Scipione adce07dae3 Mail: Style fixes related to text control color updates.
Change-Id: I3e642194ecad877f75f13e0031b9b234541f19aa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10008
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-12-31 19:24:27 +00:00
John Scipione 9215b337a9 AboutSystem: Live update credit text view colors
Change-Id: Ibf5737f3724451f1e4e1a0272333e66759cc72e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10132
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2025-12-31 12:54:15 +00:00
John Scipione 783ceb6c24 Tracker: Sort volumes before folders if you have "List folders first"
setting turned on (default on). Implements #19807

Sort root (aka Disks) before volumes and folders.

strcasecmp => NaturalCompare in one more case.

Change-Id: Ib907ae07edd47e802dcf4263e1bd676e1fa074ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9761
Reviewed-by: humdinger humdinger <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-11-30 19:05:25 +00:00
John Scipione b109d591fa Tracker: File panel responds to Tracker Window settings.
Change-Id: Ie9cf791566a20b4d44987ee84a7a34e78cccd136
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9763
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-11-30 19:05:25 +00:00
John Scipione d7022afd57 Tracker: Simplify adding/removing poses when mounting/unmounting
... and sorting.

Change-Id: Ia72e85d12682d4f77200629f3f5f278a9a40c423
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9890
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-30 19:05:25 +00:00
John Scipione 1584b1ecab Tracker: BPoseView replace BView with _inherited and style fixes.
Change-Id: Ic24f4ee3831a94a659cc584e5b4393f08695061d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9889
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-30 19:05:25 +00:00
John Scipione 8df94f989a Appearance: Compose fake scroll bar height.
Change-Id: Ife4d1f6f73934ac23b3d81cb7a249d0579377464
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9896
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-29 19:36:01 +00:00
John Scipione 46386c023b HaikuControlLook: scroll bar thumb dots 2px wide
... instead of 1px so that they are more visible.

(as requested by CodeforEvolution in #9137)

Change-Id: I7419f0422b89f26ed9d2bb5e7510ff35561643a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4333
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jessica Hamilton <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-11-29 19:36:01 +00:00
John Scipione fe86227a3f BPartition: Return B_BUSY when calling Mount()
... on an already mounted volume.

Change-Id: I7bffa385c6d1850db9106c3ab9a5a66e79165d11
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10024
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-27 05:16:01 +00:00
John Scipione b5884b112e Tracker: Clear drag data on MouseUp().
The same is done at the top of MouseDown.

Fixes #19402.

Change-Id: I75fe2249a585612c859d80a7a71825b5cb1b1df8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10026
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-27 04:10:53 +00:00
John Scipione 5388208c0b Tracker: Fix EditFirstWidget() pose location in icon mode.
The old code works because in icon-mode you have just one row
but this is not the intended way to determine the pose location
in icon mode (and mini-icon mode).

Refactor CommitActivePose() and kEditName in PoseView.

Use CurrentPoseList() to use filtered or regular pose list
(but don't update both).

In practical terms this should do nothing.

Change-Id: Iedafb147a6963bdb1411491be25641141325c1bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10025
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-27 04:10:53 +00:00
John Scipione a8deca6c41 fat: Do not prevent multiple simultaneous mounts.
This was preventing open() from getting the volume icon
once a FAT volume was mounted. This is now handled in the VFS.

Fixes #19303.

Change-Id: I5837bcdd4496b5eda13610e9ded661f1529364ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10023
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-27 04:05:55 +00:00
John Scipione 646294695d AboutSystem: Simplify updating colors.
Change-Id: Ide961bc25e6e84dcac41d6a2b62130e759762e8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9773
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-15 18:38:56 +00:00
John Scipione 0c041e8c47 Tracker: Pass workspaces activated message to Desktop on
... so that replicants can receive it to update their colors.

Forward a workspaces activated message when Desktop color changes
as well for the same reason.

Fixes #19816

Change-Id: I7b8bf8b7decc3ce088881ccb29492db6a41945b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9772
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-11-15 11:34:51 +00:00
John Scipione 7d87f76306 Mail: Don't override default panel bg color in AddressTextControl.
Fixes #19818

Change-Id: I35cdad7593bb95119b3611b68fa6dcbdf731a136
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9861
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-15 09:33:08 +00:00
John Scipione 756b7aa7ca HaikuControlLook: Restore colors in DrawLabel().
Change-Id: I031aab9fdb0b648d5285beb64893fdd5f00b62a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9771
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-11 17:11:00 +00:00
John Scipione be16e7f768 BSlider: Fix text color and also on Desktop replicant.
desklink: Set view color transparent on media volume replicant,
redraw when switching workspaces as background color may change.

HaikuControlLook and BeControlLook: Update label text color on
Desktop to black or white depending on background color. Ignore
passed in text color on Desktop. Disabled text tinting also
applies to Desktop text color.

Fixes #19700 (properly), #19800

Change-Id: I351bc046721297e85166dd8bd3a2ba63fe2cd09f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9770
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2025-11-11 17:10:13 +00:00
John Scipione 6c9c1b32e0 BControl: Don't set colors in AttachedToWindow().
BButton background drawing issues from hrev49993 has been fixed
by nephele's recent control color updates. This frees BControl
classes to be able to draw their background transparent.

Change-Id: Ic739782807f91deb11f7e1a3c3c9e2ef60734334
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9782
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-11 17:10:13 +00:00
John Scipione 142022d4c8 Appearance & Terminal: Cleanup cruft and fix minor style issues.
Change-Id: I1b1d50763f2058870d5cfd1600f6f67f0b4733f5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9778
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-11 17:03:00 +00:00
John Scipione 8c7f77a0b2 Tracker: Limit hit rect to the icon and label in icon mode
(and mini-icon mode).

This fixes a regression from R1B5 allowing you to click on the blank
area to the left or right of the icon of a file with a long filename
to select it. You once again have to click on either the icon or the
label to select the file.

Fixes #19753

Change-Id: Iae8b7c4561f2bfdda1361d4bbee4e87ecde2bb06
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9745
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-30 03:51:10 +00:00
John Scipione a6432a2ba0 Tracker: FilePanel Redirect file panel delete shortcuts to pose view.
Fixes #19717

Change-Id: If53505fc83be09c2fca9b03cd582bfc75f58765b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9608
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-27 18:31:23 +00:00
John Scipione b5f002d66f Tracker: Add "Edit query" and "Close all in workspace" to Query window
Fixes #19759

Change-Id: I547e38c46c2f9abf369a0278b433fa01ac911477
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9666
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-27 18:24:26 +00:00
John Scipione 17a87a2077 Tracker: Add Disks to Desktop nav menu if "Show Disks" setting is on.
Rename AddRootItemsIfNeeded() to AddVolumeItems().

Fixes #19720

Change-Id: I866b7364012b2d267809d9f49059ef531ec4a24f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9741
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-27 16:28:45 +00:00
John Scipione a20098f186 libsolv: Define HAVE_STRCHRNUL on darwin
src/libs/libsolv/solv/repodata.c:246:27: error: static declaration of
'strchrnul' follows non-static declaration
  246 | static inline const char *strchrnul(const char *str, char x)

Change-Id: I4a93b1c361ba32d3984567ca24bd1d473a252555
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9740
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-27 15:33:41 +00:00
John Scipione 82fb83956a BSlider: Set text to panel colors. Fixes #19700
Change-Id: If5b16052a093dbd19c0e85b53d604ed36903710e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9581
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-06 22:13:18 +00:00
John Scipione 7061f99814 Tracker: Rebuild add-on menus using node monitoring in fewer cases.
Change-Id: I5825a94cab14feb509e96c7d0c85848abf28cb37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9073
Reviewed-by: waddlesplash <[email protected]>
2025-08-05 15:57:19 +00:00
John Scipione 2ff08f46cb Tracker: Replace an instance of static_cast with dynamic_cast
No fundamental change here, Tracker might be used as a kit and
this will fail as be_app is not Tracker.

Change-Id: I1e2d8e143e996c008cd03771d34f20198d8109c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9577
Reviewed-by: waddlesplash <[email protected]>
2025-08-03 22:50:43 +00:00
John Scipione e32d782cb4 Tracker: Allow draggable container icon on Root, Trash and Printers
Use new DraggableContainerIcon name when invalidating icon.

Create a ShouldHaveDraggableFolderIcon() method on BContainerWindow
to consolidate the gating logic to a method.

We alert if you try and copy, move or create link to any of these
directories, however you may drag the icon in some instances such as
to change the directory in a file panel or to open the directory up
in FileTypes. You may create a link to the printers directory.

Set the Printer icon on the printers directory.

Fixes #3385

Tracker: Disks menu in CountView

* Open Disks directory on click.
* Skip volumes with no capacity (e.g. system, config) from
  Root and Desktop menus (still shown in Home and volumes though).
* No Trash on volumes, add only to Desktop.
* Declare some variables outside loop.
* Rename originatingWindow to source.

Fixes #3549

Change-Id: I66318d2485a5a8405f5459c355a467f34e19ecc5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9499
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-30 04:07:05 +00:00
John Scipione f1cc4cf8cb Tracker: Truncate name better in icon mode, don't draw outside.
The max width of the file name was getting set by the width of the
name column, even in icon mode. Use an arbitrary max width of 30em
for the name field in icon (and mini-icon) mode instead.

Set fValueIsDefined on name and other attributes.

Do not attempt to truncate name if !fValueIsDefined, this means
that the value is "-" to show that it is undefined. We assume this
should fit and there is no way to truncate the value.

If the value is later defined it is marked fDirty to truncate it
to the available space.

Fixes #19431

Change-Id: I4cb7953bc746039600ee578b4fa6b786c802bdf8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9516
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-07-30 04:02:39 +00:00
John Scipione 08bdab7600 Tracker: Fix remaining drawing artifacts, last part of #18826
Change-Id: I9483d67bfb98207e1cde726aaa00df6031933f3c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9496
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-07-30 04:02:39 +00:00
John Scipione 64334a1580 Tracker: Redraw Trash icon when pose attribute updates.
* Don't set Trash icon in FSGetTrashDir anymore, do it in TrashWatcher.
* Write vector icon to attr or large/mini icon attrs, but not both.
* Only update Trash icon attribute on boot volume, not the hidden trash
  folder on other volumes.
* Monitor Trash icon attribute changes by TrashWatcher in BPoseView.
* Get rid of ShouldUseWellKnownIcon(), update ResetIconFrom().
* Remove model param from BPose::UpdateWidgetAndModel() and always use
  the ResolvedModel() of the pose instead.
* Pass poseLoc into BPose::UpdateWidgetAndModel() in icon-mode.
* Workaround for GetAttrInfo() failing to update removed icon attrs.
* Check fNode not NULL in Model::StatChanged() to prevent crash when
  unmounting volumes with trashed items.
* Filter out 0 capacity volumes checking for Trash directory.

Fixes #8696

Change-Id: Ief2efc07c85866cc0e49468c668e47ec90b855af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9458
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-30 04:00:12 +00:00
John Scipione d4b0e30b56 Tracker: Write Desktop vector icon attr or large/mini icon attrs
... but not both.

Change-Id: I4bb38e011dcef0e6bbc092c9acf6a826bd867d30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9477
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2025-07-30 04:00:12 +00:00
John Scipione 091cc6357e Tracker: Set location in BPoseView::UpdateIcon() for icon-mode.
Change-Id: I8d4fea5eea7a19daedd31bd81cd59270a2b56720
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9476
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-07-30 04:00:12 +00:00
John Scipione 43db356db7 Tracker: GetInt32() instead of FindInt32() when getting opcode
FindInt32() works in this case but is deprecated.

No functional change intended.

From the BeBook BMessage page:
"Several functions, such as FindRect() and FindInt32(), have versions
that return the found value directly. These versions don't report errors
and may not be supported in the future."

Change-Id: Ida979153dd00e247c2174edd73d0019752b388f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9079
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-07-28 21:26:42 +00:00
John Scipione 448e39f9c3 Tracker: Fix esc to cancel type-ahead filtering in file panels
... by redirecting message to the PoseView. Filter out lock modifiers.

Fixes #13151

Change-Id: I0a17334aeb3b04b6271dec47e58aa4933ec6a0a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9525
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-28 12:34:49 +00:00
John Scipione f5dffd5ca3 Tracker: Filter out lock modifiers on Open with window
Change-Id: I73bd38b3596a9f9d5793df4bd11f32c62d6e7eff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9524
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-07-28 12:34:49 +00:00
John Scipione abc4a28949 Tracker: File panel misc style fixes
Change-Id: I6376e52d26ac05e0f591c2484a7c7301cee6166b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9523
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-07-28 12:34:49 +00:00
John Scipione 24f4871106 BWindow: fix Quit shortcut, uppercase the inputted key
Change-Id: Ic6c80fc0cce033bcffcd7f0934a9ecf7f6825c00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9521
Reviewed-by: X512 X512 <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-26 17:37:59 +00:00
John Scipione f21782699a Tracker: Show mounted volumes on Desktop in file panels again
Add switch to Desktop and Home shortcuts. Fixes #15148
Show Volumes or Disks on Desktop in file panel. Fixes #19547

Rename Add/RemoveRootPoses() to Add/RemoveVolumePoses().
Use default Tracker values when adapting to setting changes.

Bring ShowVolumes() into BPoseView and apply the same logic
used by file panel to DesktopPoseView to switch between Disks
and volumes on Desktop.

Add Disks or volumes to file panel in BPoseView instead.

When you set Show Disks or Show Volumes, set the other as well,
they are opposites of each other.

Remove unnecessary params related to adding/removing volumes.

Rename ShowVolumes() to ToggleDisksVolumes() and move to BPoseView.
Create IsVolumesRoot() to identify Desktop in a file panel.

Change-Id: Id250aa6cf7386c7988017a9edbdb16ec9cea00ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9503
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-07-23 23:05:51 +00:00
John Scipione c16a8cad1a Storage Kit: Add support for FAT16 type
Change-Id: I626550b83179e5ad429ed7b8ebc6b8d320446cbe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8959
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-07-21 10:46:06 +00:00
John Scipione b58c23c7c6 Menu docs: fix typo
Change-Id: Icc789b5d2652dca3a64c3bbc5572821747efa75d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9438
Reviewed-by: waddlesplash <[email protected]>
2025-07-02 19:12:03 +00:00
John Scipione e362f604f4 Revert Interface Kit: BWindow owns (and deletes) menu sem and friends
This reverts commits:
39083dd0f7
0f430ba35c
ac55439364

Fixes #19553

Change-Id: I40f9a694079d4376221099e1d1b99208aeb207b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9416
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-30 17:43:51 +00:00
John Scipione b515400884 BButton: Document AdoptSystemColors() and HasSystemColors() in the Haiku Book.
Change-Id: Ibe72cc796738e90beee9388eaba95342ab48640d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8898
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-30 14:57:07 +00:00
John Scipione 15c87be3ea ColorListView: Handle color dropped on unselected
Remove shared message handling from ColorListView,
you are expected to implement this yourself and these
message constants were not actually being used by
the message target.

Do color drop handling in Appearance and Terminal.
Handle all color drops in WasDropped().

Allow current selection to remain, only update color.
TODO Changing selection on external drops should be
fixed in BListView. Work-around in BColorListView.

Fixes #19562

Change-Id: Ic99bbb1288fd736778eac831d38e453122815abc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9296
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-30 14:56:42 +00:00
John Scipione 0d91cd6464 Tracker: Add Paste item to volume window context menu
Change-Id: Iaa8b992011510364cf1eb9a3f0e6a6e749eefe5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8955
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-06-30 14:55:52 +00:00
John Scipione 76f3ceaadc Deskbar: Reduce window height by 1 in mini-mode
Adjust tray icons and clock to fit accordingly. Leaf menu height is
reduced by 1 in vertical mode to match.

This makes the overlap of maximized windows and Deskbar less noticeable,
especially in horizontal mini-mode.

Fixes #16231

Change-Id: I622d008ee093e018ebcb46e3c45647577f46184f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8833
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-06-30 14:54:49 +00:00
John Scipione bcea01a853 Tracker: Fix Select shortcut again Fixes #19596
Change-Id: I0652ee11bb66e9b0ce9eaef8f9d7dc4f6975641e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9320
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-01 03:09:31 +00:00
John Scipione 60bb9a9f96 BControl docs: Sum up abstract nature of BControl and how to set colors.
Change-Id: I509e5325a8fcfdc3bf75ba3e35c887c93099d3c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8980
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-05-26 20:08:52 +00:00
John Scipione cb4a168e37 Tracker: menu parameter is ambiguous, rename to parent instead
Change-Id: I9a8811ff8c142efcdfbebae0c2b6e438290eafcd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9061
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-04 14:50:27 +00:00
John Scipione 39083dd0f7 BMenu: Fix infinite loop regression on right-click drag
... wait while B_INTERRUPTED instead of != B_BAD_SEM_ID.

Change-Id: I58f81762bddec1e7f4b01e2b7806c395632ba992
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9028
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-22 05:29:57 +00:00
John Scipione d6c5aee9f9 Tracker: Draw all columns, fixes bug invalidating off-screen columns
AFAIK this has always been this way, however, the confusion seems to
be that pose->CalcRect() takes false for minimal rect while pose->Draw()
takes true for full-draw so they are opposites of each other.

This means we draw all columns on Invalidate(), not just the first one.

Change-Id: I40ddf5fa75b46d6da987fd5d5f83cdc4782fa851
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9019
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 6848bca37f Tracker: Raise opacity of dragged and cut items, fixes #19429
Change-Id: If498bb79a55697b2c270f3f21383d3c4f3a3d567
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9014
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 40bb2f8c9f Tracker: Make drag fade rect a bit bigger and compose it
Change-Id: I2bfa9b5416cced7627f87613180c6b7c192be0d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9013
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione c24d316399 Tracker: Gray text on selected items in inactive windows, fixes #19428
Change-Id: If73faba3682c5360a15e4e87983d8c377216cb5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9017
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 82c55a447b Tracker: Use drawView instead of view in one place
Change-Id: I8ae87ca92c0749ce41bc11d1d59dcbcf38d9f25e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9016
Reviewed-by: John Scipione <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 0f430ba35c BMenu: Revert a small piece of hrev58661
Do not _Uninstall() whenever we _Hide() in BMenu again.

Fixes menus in Terminal and elsewhere.

Change-Id: Ic89ee2e4b0a94cc11c7a4091d9ce01e6ff6bb915
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9018
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 20:07:55 +00:00
John Scipione ac55439364 Interface Kit: BWindow owns (and deletes) menu sem
_Uninstall() before _Hide() in BMenu because the window must
be available when we _Uninstall() especially for shortcuts.

Remove #define and always assume USE_CACHED_MENUWINDOW.

_Uninstall() whenever we _Hide() in BMenu.

Change-Id: I5dae85f6edf1f0b4ccf67a6d9d77470576671cee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9012
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 17:28:00 +00:00
John Scipione adc74a927c Tracker: Take precautions against rounded invert rect, fixes #18826
Change-Id: Ic4a33b960d8be6c5242d66f21aae2e0184c5cbc8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8976
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-19 08:02:08 +00:00
John Scipione fbe7c9072c Tracker: Update pose/text widget to fix some problems
* Remove the unused width param from TextWidget::Draw(), we don't need it.
* Simplify UpdateIcon() with new _ListIconRect() and _IconRect() methods.
* Remove bad drawView->SetDrawingMode(B_OP_OVER) from TextWidget:Draw().
* Set cut and dragged item text based on high color instead of low color
  initially, then switch to low color when drawing text widget since the
  low color has been set.
* Restore cut item and dragged item high color after drawing outline.
* Fix regression in list view drawing dragged item label.
* Use correct CurrentPoseList() in list mode and icon mode.
* Always break when encountering NULL pose, don't bother to continue.
* Invalidate instead of redrawing on Select all.
* Split Extent() into ListModeExtent() and IconModeExtent().
* Init fListElemHeight and fListOffset in the initilizer list
* Init sFontHeight in earlier in InitCommon().
* Rename resultingIndex to resultIndex to make it fit on one line.
* Update pose and text widget CalcRect() to position everything
  (it basically already was but this standardizes ceilf and floorf).
* (use / 2.f to avoid trunction, just in case)

Change-Id: Idc8ccffdbe000bb126ab195e9739e7e5b9392bb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8971
Reviewed-by: John Scipione <[email protected]>
2025-02-19 08:02:08 +00:00
John Scipione cd461bd05c BColumnListView: push/pop state to restore colors after column resize
Change-Id: Ic6d6d96a3a401051ca399cf853c3d800afe6d3fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8970
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-19 08:02:08 +00:00
John Scipione 13d645a0fe Tracker: Set read-only low color on ColumnResize()
Change-Id: I6344d7e3e6363da068b8b5ede818c01070c7484c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8998
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-18 21:13:51 +00:00
John Scipione 046f27c114 Tracker: Prevent Add-ons from being rebuilt too fast, fixes #19426
Change-Id: I016aa63979c9e4b3a28d486538e98df8cd2e2fa9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9007
Reviewed-by: waddlesplash <[email protected]>
2025-02-18 21:13:40 +00:00
John Scipione 759dfd5ae3 Tracker: invert inactive select color so it is how it was
Change-Id: I5d79fc733496746bceb7003cb7d8a70555d87732
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8972
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-13 02:02:59 +00:00
John Scipione c78383f720 Tracker: Populate Tracker add-ons into main menu bar
This is used by some Tracker add-ons including TrackRunner and TrackGit.

Fixes #19386

Change-Id: I329eb9f1f8b2abf2872593d8f4417fa82de0b521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8911
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-11 03:59:26 +00:00
John Scipione 3953c0e7cd Tracker: Fix list icon click regression, Fixes #19414
Change-Id: I96d8995087bf8621ff580ad3b4ed54ae59786e32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8964
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-10 20:16:08 +00:00
John Scipione 7d6ff0554b Tracker: Fix one more artifact drawing issue
... related to Pose and TextWidget not exactly matching.

Change-Id: Ic9c3f2ecc9a9dc4af4c200bc5a16b9f46d72f9b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8954
Reviewed-by: waddlesplash <[email protected]>
2025-02-09 03:02:07 +00:00
John Scipione c368793cd4 Tracker: Fixup drop context move to enabled status
regression from hrev58560.

Change-Id: Ic62292c2eb38e486cf18f0e4e9535ff6154b0c87
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8953
Reviewed-by: waddlesplash <[email protected]>
2025-02-09 03:02:07 +00:00
John Scipione 2cf974a04e Tracker: Do not create symbolic link on same folder
Fixes #19403

Change-Id: Ib590822308b819d60715139c536d60e4e14c510f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8950
Reviewed-by: waddlesplash <[email protected]>
2025-02-08 22:37:07 +00:00
John Scipione 475412d382 Tracker: Fix minor underline issue from hrev58610
Change-Id: I80098f8bb10ab5eb1b8c39b5acb698ea0163bd85
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8949
Reviewed-by: waddlesplash <[email protected]>
2025-02-08 22:37:07 +00:00
John Scipione 0464dc83d9 BMenuItem: Fix Alt+1 to switch to icon mode in Tracker
... by setting the incoming shortcut instead of the old one
in BMenuItem::SetShortcut().

Fixes #19405 a regression hrev58611.

Change-Id: Iecf19a323f6b6ead288e3f1ef1169376b11cddb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8948
Reviewed-by: waddlesplash <[email protected]>
2025-02-08 22:37:07 +00:00
John Scipione e4ef7b6075 Tracker: Redirect B_DELETE to BTextView if focused on one
Fixes #19404 a regression from hrev58560.

Change-Id: Iea6df69e04f5dccb8f91be506b5b7f85686c5eb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8947
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2025-02-08 22:02:29 +00:00
John Scipione a502215d78 BPopUpMenu: Adds Alt back to pop up windows
... by calling Install() on Go() in BPopUpMenu.

Install() prepares item shortcuts and set missing targets to the
target window. Combined with hrev58611 for regular menus this
passes most of the shortcut prep work on to BWindow.

Fixes pop up portion of #19395 a regression from hrev58589.

Change-Id: I8a1615502e0d6e0b75f9cd3ca2a45d08b53d11ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8946
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-08 17:59:44 +00:00
John Scipione f28ee3ec24 BPopUpMenu: style updates, update copyright year to 2025
... and style fixes. Add myself as author.

Change-Id: I213ba5e1dabf1cf15db86c307fb3484231947332
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8945
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2025-02-08 16:08:30 +00:00
John Scipione 5ee786c31f Interface Kit: Fix missing Alt key in menu shortcuts
The shortcut detection was working, just not the display of the
modifiers in the menu. I've added back the necessary code to fix
this in BMenuItem.

BWindow does the heavy lifting of preparing the keys and
modifiers. I have changes _FindShortcut() used by BMenuItem to
send the prepared modifiers back to BMenuItem.

Set the parameters raw in the constructor, they will get fixed
up in Install().

I also make sure to use the prepped version of the key and mods
in BWindow::AddShortcut() to remove the old one. This is a minor
update that eliminates an edge failure case of malformed input.

Fixes #19395 a regression from hrev58589.

Change-Id: I4333f89149ff843f92dbffbd53d58ffc2def6760
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8943
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-07 17:00:56 +00:00
John Scipione 2c7072f33c Tracker: Fix label redraw issues in mini-icon mode
... and center label vertically.

Fixes #18826

Change-Id: If96ce2089cbf8345d147d39b091317168bcf5c1a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8886
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione 3527a0ee23 Tracker: Fix garbled text when dragging cut poses
* Determine whether we're currently dragging by looking at the
  current window message what, dragging replaces direct in a few
  places especially crucial to drawing semi-transparent dragged
  items correctly.
* Export kMsgMouseDragged and kMsgMouseLongDown to the BPoseView
  header to check for dragging (but still in BPrivate).
* Turn on outline label drawing for dragged items and remove TODO.

Fixes #6461

Change-Id: I45cd401299dec408b76cb4b9ce1e9350ed59ef5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8842
Reviewed-by: waddlesplash <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione 44d74ab075 Tracker: Refactor BPoseView and BPose drawing
* Create a DrawTextWidget() method in BPose to share drawing
  between list and icon modes.
* Remove direct param from BPose::DrawIcon() and remove the state
  changes from that method.
* Remove direct parameter from TextWidget::Draw(), we can calc it.
* Refactor BPose::Draw() to set the LowColor() only. This is now
  considerably more simple to read and understand.
* Refactor ColumnRedraw() to reset colors and drawing mode.
* Many explanatory comments added.

* Remove BackColor() and TextColor(), use LowColor() and HighColor().
* Use AdoptSystemColors() and HasSystemColors() to set colors.
  These are virtual in BPoseView and the colros are overridden by
  DesktopPoseView, OpenWithPoseView and QueryPoseView.
* Add ReadOnlyTint() version to Utilities that takes a color_which.
* Rename InvertedBackColor() to InvertColorSmart().
* Force Edit name select box background color to be black/or white
  depending on the inverse of your background color on Desktop
  instead of using document colors.
* Determine if volume is read-only by pose instead of its parent,
  this fixes a bug where read-only volumes mounted on a read-write
  directory like the Desktop had an editable name even though they
  were not supposed to. It wouldn't let you change the name though.

* Remove fIsDesktop param from BPoseView, use only IsDesktopView()
  now except in FilePanelPoseView when navigating to the Desktop.
* Update BContainerWindow, DesktopPoseView and FilePanelPoseView
  to adjust to this change. IsDesktopView() is always true for
  DesktopPoseView, never true otherwise.
* DesktopPoseView disambiguated further from BPoseView. Add a few
  virtual override methods.
* Custom Brightness() value on DesktopPoseView based on the default
  Desktop color.
* Respond to B_WORKSPACE_ACTIVATED and B_RESTORE_BACKGROUND_IMAGE
  messages to update the Desktop text color.

Change-Id: I122dbeab668244772012656a59cbba3050245f44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8885
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione 0ed8ac17f2 Tracker: Do not start editing file name while dragging
Change-Id: Ibf215fb2dd1ed2cac56c0db47fab788f8b99646f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8867
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione c24ebeeacf Tracker: Code simplifications related to dragging
Pass buttons into DragSelectedPoses instead of calling GetMouse(),
and bail out if a mouse button is not down.

Eliminate HeaderView::fMouseDown, get buttons from CurrentMessage()
instead. Reduce icon_track indent by breaking early on invalid.

Add B_WILL_DRAW flag to bitmap drawing view.

Refactor BPoseView::MakeDragBitmap().

Move DragStart(), DragEnd(), Dragging(), (now IsDragging())
DragMessage() and related method parameters from BContainerWindow
to BPoseView. This avoids having to dynamic_cast to get the window
from the pose view.

Put bool params at the bottom of the BPoseView class with width 1
to facilitate packing.

Remove buttons parameter from WasDoubleClick() and get from
Window()->CurrentMessage() instead (along with clicks).

Change-Id: I94b345e44af7b1136f94ded02e9c2a118188a877
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8841
Reviewed-by: waddlesplash <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione 0f3d21e82d Tracker: Style fixes related to dragging
Change-Id: I540263aeb58710a1c1a2747a9d5784614a5fd791
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8882
Reviewed-by: waddlesplash <[email protected]>
2025-02-06 22:08:11 +00:00
John Scipione 49d3b2a142 Tracker: Fixup hardcoded values for ModelMenuItem padding
This is to make BMenuBar and BMenu margins the same.

The hardcoded menu item margin numbers come from this math on what the
BMenu and BMenuBar item margins respectively used to be a long time ago:
14 - 8 = 6 // for left margin
(14 + 20) - (8 + 8) = 18 // for left + right margin

We have since updated these margins so they need to be recalculated.
Use BPrivate::MenuPrivate to get the new margin deltas.

IconMenuItem and ModelMenuItem classes are used by Tracker add-ons and
those can be in the menu bar as well.

Change-Id: Ie4147c31e6b19764cb36b9c414f7e91c47b7d9bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8905
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-02-05 16:38:08 +00:00
John Scipione def8a585fa BuildSetup: ld on darwin does not support --no-as-needed
Change-Id: I2f5ada95d5f8b346374aebc3a1a8114f345cb29f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8906
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-04 17:27:04 +00:00
John Scipione 5610706bb6 BMenuItem: Remove _DrawFunctionChar() cruft added in hrev58589
Change-Id: I7fbc1dc194be91705646f6e822d03e9773bd649a
2025-02-03 02:39:27 -05:00
John Scipione 16c6cc4418 BTextView: Fixup AdoptSystemColors() and HasSystemColors()
Replace private _UsesSystemColors() with public HasSystemColors()
and make sure to consider the tints when checking if system colors
are used or not.

Document HasSytemColors() in the Haiku Book.

Change-Id: I78de4904d5ddb24b98ad27eb93d4e5ccb330d76a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8897
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-03 00:14:52 +00:00
John Scipione 74ef92bc55 BTextView: Update word-wise/line-wise shortcuts
... and set alternates. This is updated because we can now set
shortcuts without B_COMMAND_KEY. Setup Alt for Win/Linux mode.

* Word-wise shortcuts Option+arrows.
* Line-wise shortcuts Alt+arrows AND Ctrl+arrows for
  Win/Linux mode and for when there's a conflict.

Otherwise these shortcuts are not expected to conflict.

Add shortcuts for Alt+Backspace and Alt+Delete to delete to
the beginning or end of line instead of word.

Split out vertical and horizontal shortcuts so that if one is
used by an app we at least get the other one.

Fixes #9913

Change-Id: I0124fec7df4585a70ded8d3e7bf2aa8cb4acecb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7289
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-02 19:18:35 +00:00
John Scipione 58339b6be4 Tracker: Change "Move to Trash" shortcut to plain DEL
... without Command. Shift+B_DELETE to skip Trash.

Change-Id: Ibd334b62154f488b91d1e0aaf287f478724f38a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7178
Reviewed-by: nephele nephele <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-02 19:18:35 +00:00
John Scipione 540ae21864 MediaPlayer: Delete playlist items use plain old delete
... fixing a TODO now that #7078 is fixed.

There are 2 remove playlist actions: 'Remove' and 'Move file to Trash'

* 'Remove' playlist shortcut: Cmd+Delete => Delete
  (This also works from the main window to remove the file you're
   currently focused on/listening to from the playlist.)
* 'Remove file from playlist' shortcut has been removed. We have
  decided not to Trash files from MediaPlayer's playlist anymore,
  you'll have to trash the files from a regular Tracker window.

The 'Remove' shortcut gets plain old delete as the author intended.

Change-Id: I3b1e19405e029d9c5f398cfd7a8dbab49fb21fc7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7292
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-02 19:18:35 +00:00
1e2091ced5 Interface Kit: Add support for shortcuts w/o Command
Introduce B_NO_COMMAND_KEY modifier that is used when a
shortcut has no Command modifier, otherwise B_COMMAND_KEY
modifier is added.

This is conceptually different from B_NO_MODIFIERS in that it
allows other modifiers such as B_CONTROL_KEY, B_SHIFT_KEY and
B_OPTION_KEY to be added to a shortcut, but not B_COMMAND_KEY.

This option is required to remove B_COMMAND_KEY because the
Command modifier is assumed to be present on all shortcuts.
This allows us to break this assumption without breaking apps
written before this change and assume B_COMMAND_KEY to be
present even if it has not been explictly added.

Document B_NO_COMMAND_KEY in BMenuItem and BWindow docs.

Fixes #7078

Co-authored-by: X512 <[email protected]>
Co-authored-by: Ryan Leavengood <[email protected]>

Change-Id: If0e20cd848112898f4425ede8c17231dc50deb8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7293
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2025-02-02 19:18:35 +00:00
John Scipione 69970cdd5b Tracker: Open file location on double click from Query fix
Regression from hrev58560.

Originally: `be_app->PostMessage(&message);`
In hrev58560 it was changed to: `Window()->PostMessage(&message);`
Now: `BMessenger(kTrackerSignature).SendMessage(&message);`

The distinction between original and now is for if Tracker is being
used as a kit, in practice this shouldn't make a difference.

hrev58560 was not correct though.

Fixes #19381

Change-Id: Ia48a8adcf2c9853e8309266369ccf7452c20a679
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8890
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-01 21:36:11 +00:00
John Scipione 56dce2b3d4 Tracker: Insert "Mount >" menu at the right location
Fixes #19388 a regression from hrev58560

Change-Id: Iec03b278aa88c5e544962130c6942c5497598b67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8884
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-30 05:06:48 +00:00
John Scipione bd2d95cf90 InterfaceDefs: Reorder enums in ascending order, show gaps
Change-Id: I926d0f02e74ea97c302bc4d1794819b60be2874b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8864
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-27 17:19:49 +00:00
John Scipione 4624f9f260 Tracker: Add Cut/Copy/Paste items to context menus
Remove CUT_COPY_PASTE_IN_CONTEXT_MENU define entirely.

Change-Id: I457ee140c2bde7e5ab750528b3196adfe9eb7018
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6358
Reviewed-by: John Scipione <[email protected]>
2025-01-26 18:29:22 +00:00
John Scipione 683100d673 Tracker: Live updating shiftable menu items
Live updating menu classes listen for B_MODIFIERS_CHANGED
messages and update the item label and shortcut on Shift
or Control.

-- File --
Create link => Create relative link
Move to Trash => Delete
Cut => Cut more
Copy => Copy more
Paste => Paste links
Identify => Force identify

-- Window --
Close => Close all
Open parent enable/disable on Control to open root window

-- Window => Arrange by/Desktop --
Clean up => Clean up all

Create TLiveMenu and TLivePopUpMenu classes that inherit from
BMenu and BPopUpMenu respectively.

Create TLiveFileMenu, TLivePosePopUpMenu, TLiveWindowMenu and
TLiveWindowPopUpMenu subclasses for the File and Window menu
and context menus respectively.

Create TLiveMixin to share methods between menus. Pass in parent
window and use window shortcuts to enable/disable "Open parent".

Change-Id: I5dfbd4d468fad02894f1f31aa08d1abf630a4b5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2293
Reviewed-by: John Scipione <[email protected]>
2025-01-26 18:29:22 +00:00
John Scipione 5b1284db40 BMenu: Inform parent menu when modifier keys change
BMenuWindow: Move submenus over recursively if layout changes.

Fixes #15782

Change-Id: I70e67c3514a3b850f5b5893170b9a34a9176363e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2324
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-26 18:29:22 +00:00
John Scipione bc61d0aef5 Tracker: Show Open parent menu item on Trash
Change-Id: I754f1457db76f0c3511e4c8d4bf9b236591ccbe2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8703
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-26 18:29:22 +00:00
John Scipione 9df392ba32 Tracker: Treat root (aka Disks) like a volume
This yields the volume context menu on the Disks icon. Grab root
(Disks) icon before getting volume icon so Disks doesn't get the
generic volume icon. Don't add free space bar to Disks.

Add Mount menu to the Disks File menu and context menu. Mount
settings option has been removed as you can get to it from inside
the Mount menu instead.

SetupMountMenu() method is used to insert the Mount menu similar
to SetupOpenWith() and SetupNavMenus(). Add DetachMountMenu()
convenience method.

Fixes #5584

Change-Id: Ic9e272807a0a36b89cba7258b9937b09b2da32dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7151
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-01-26 18:29:22 +00:00