Commit Graph
100 Commits
Author SHA1 Message Date
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
John Scipione e46d9f45b8 Tracker: Shortcuts refactor
Create TShortcuts class that builds shortcut menu items and updates
label, modifiers, enabled status and target. Not every Tracker
shortcut is present but ones used multiple times and many others are.
Update shortcuts in ContainerWindow, DeskWindow, FilePanelPriv,
QueryContainerWindow, VirtualDirectoryWindow and GetInfo HeaderView.

There are two versions of the TShortcuts class, one with a window and
one without. The without-window version is used in the GetInfo window,
everywhere else uses the "smart" window version.

This patch is organizational except fixing two small BeOS bugs:
* Edit query item is always between Open and Open with...
* Repopulate menus when you switch directories in file panels.

Enable "Open parent" item in spatial mode as well as navigation
mode unless in Root, Desktop (Query or Query template) or volume root
if not in "Show disks" mode. Hold down control to override.

BContainerWindow updates:
* Absorb Set...Item() methods into TShortcuts. Add
  UpdateMoveToTrashItem() for "Move to Trash"/"Delete" and many more.
* Absorb ShowContextMenu() improvements from Disks patch.
* Create AddIconSizeMenu() and eliminate duplicate shortcut handling.
  * Put icon size menu in radio mode and refactor item marking.

Replace "New folder" with "New >" menu automatically. Create member
vars and convenience methods to facilitate this. Simplifies building
menus, adding a "New folder" item will automatically be updated to
"New >" if templates are available (except in FilePanel and on the
minimal build you'll just get "New folder").

Refactor Arrange by and Attributes menus. Create support methods.
Create menu on add, populate on update. Do cleanup of detached menu
on Quit().

Refactor SetupOpenWithMenu(). SetupEditQueryItem() got a similar
refactor to be added and removed dynamically. Add FSIsQueriesDir()
to FSUtils used to detect queries directory for Edit query.
* "Edit query" goes between Open and "Open with..." (long story).

UpdateMenu() calls Shortcut()->Update() for all known shortcuts.

Optimize adding/removing dynamic menus so that they are created
and destroyed once and reused again and again.

AddFile...(),    fFile... and "FileContext" becomes
UpdatePose...(), fPose... and "PoseContext".

TTracker changes:
* Skip Desktop in OpenContainerWindow() we setup pose view earlier.
* Move DeskWindow init into DeskWindow constructor and call Init().

DeskWindow changes:
* Replace icon size menu with BContainerWindow::AddIconSizeMenu().
* Remove WindowContextMenu(), handle in BContainerWindow instead.

BPoseView changes:
* Rename kEditItem to kEditName -- better name. Save for Edit someday.
* Use BMessenger::SendMessage() instead of PostMessage(), safer.

BFilePanel updates:
Create the FilePanel menus fresh by overriding the AddMenus() method
instead of copying from BContainerWindow and deleting the items it
doesn't need. This allows us to omit most of the file panel checks.
Add UpdateFileMenu() to update the file menu on RepopulateMenus() and
MenusBeginning().
* Create an AddFavoritesMenu() method and use it to add the menu.
* Override RepopulateMenus() to update just the File and context menus.
* Create Update...Methods() overloading the BContainerWindow versions.
* SetTo() becomes SwitchDirectory()

Unify OpenParent() so that we can call BPoseView::OpenParent() and it
will call the container window or the file panel where appropriate.
Remove BPoseView::ParentIsRoot() and make CanOpenParent() work in both
cases. This means we don't have to check if you are in a file panel or
not when enabling/disabling the "Open parent" item and the Shortcuts
class can simply check CanOpenParent().

Call _inherited SwitchDirectory() to RepopulateMenus() on Root, Trash
and Volumes in FilePanel. This fixes a 25+ year old BeOS bug by
repopulating menus when you switch directories in file panels. Trash,
files in Trash and Root will get the appropriate menu options. For
example "Delete"/"Restore" instead of "Duplicate"/"Move to Trash".

Change-Id: Ic41b148cb6bcf14288cb5588038c13ea12426dc2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7197
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-26 18:29:22 +00:00
John Scipione 4ae0548774 Terminal: Make Colors window height shorter and font-dependent
Roughly the same height as the Appearance window at 12pt font.

Change-Id: Iaa456aecfde6ebe92f4829e3aabca6a29b68bc08
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8847
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-01-22 19:28:58 +00:00
John Scipione 622853ff8e Appearance and Terminal: Move ColorPreview to shared
Move ColorListView and ColorItem to shared in BPrivate namespace.

ColorItem typedef to BPrivate::BColorItem for apps that are already
using this class.

Gravity screensaver:
* ColorItem => BColorItem.
* Use make_color() to set colors.

Make color drop message name agnostic, check for B_RGB_COLOR_TYPE.
Add be:sender and source to drag message.

Add _SetTermColors() convenience method to set colors on all tabs.

Change-Id: I5a9f55d3ab423ccaa341997cf444603373024553
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8846
Reviewed-by: John Scipione <[email protected]>
2025-01-22 19:28:58 +00:00
John Scipione 012d90c553 BColorControl: SetValue and Invoke on color drop if enabled
Change-Id: I055750707ed625b21c6b4cf02faf2509f615e169
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8845
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-01-22 19:28:58 +00:00
John Scipione a6fee6a1ca intel_extreme: Remove spurious whitespace
Change-Id: I5a15cada42d1d527b0d65f89401d04e7771ef4b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8852
Reviewed-by: waddlesplash <[email protected]>
2025-01-20 19:32:32 +00:00
John Scipione 04bf57110c Tracker: Disallow control characters in file name edit
Change-Id: I1e87768cc70fdd501ca0a4710df619dd2d59ce7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8170
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-20 16:27:04 +00:00
John Scipione 0d50dc1f3e Tracker: Call AdoptSystemColors() to apply read-only tint
2 - 1.147 = 0.853

Change-Id: I260af9d07f5e43e939ce351bfd4036665ad126f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8269
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-17 16:57:38 +00:00
John Scipione 9105063938 BTextView: Use document colors on AdoptSystemColors()
AdoptSystemColors() tints document background color to match panel
color if uneditable.

Calling MakeEditable() will automatically apply or unapply uneditable
background tint if you have previously called AdoptSystemColors().

Parent BView::AdoptSystemColors() sets panel colors, we want document
colors here. Do not alter text color - only view, low and high colors
are changed.

Document AdoptSystemColors() and MakeEditable() in BTextView docs.

Change-Id: Ib215735f27bb01fc2f95fcf2fee0185e5fc83f70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8263
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-17 16:57:38 +00:00
John Scipione 13553050f9 HaikuDepot: MarkupTextView SetForegroundColor to HighUIColor
Also the bullet point color
Allow Usage Conditions window to be resized
Tint disabled color instead of hardcoding

Copyright 2024 Haiku, Inc.

Fixes the other half of #19067

Change-Id: Ibf74d9dd673807b0f107e56cefb5b30916baed96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8262
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-17 16:57:38 +00:00
John Scipione 297aa21e46 Deskbar: Always AdoptParentColors() on StatusView
... be_control_look is assumed.

Change-Id: If41f74ede3debd5439093e0172294861f65f5d6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8832
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-01-14 22:46:39 +00:00
John Scipione e7735d59c3 Deskbar: A few minor style fixes to StatusView (tray)
Change-Id: I89036bda8bc9b93cac90c606dafe0a13cfd8a05d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8831
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-01-14 22:46:39 +00:00
John Scipione 3c18c3d5c6 Tracker: Restore IsFiltering() to IsRefFiltering() or IsTypeAheadFiltering()
Add IsRefFiltering() and IsFiltering() is once again either kind
of filtering: ref or type-ahead.

Use IsRefFiltering() in a few places, otherwise use IsFiltering()
to restore filtering code so that it gets triggered on either kind
of filter.

Make the filtering methods inline to avoid function call overhead.

Fixes #19317

Change-Id: I27407ca33e8f2b967975c8a8ef8de83105442bd4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8715
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-12-26 22:10:31 +00:00
John Scipione ffed6d0bff Tracker: 100 char style fixes to PoseView
Change-Id: Ife469064cd2e92e23da80849d4ba9f07936bf210
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8714
Reviewed-by: waddlesplash <[email protected]>
2024-12-26 22:10:31 +00:00
John Scipione fdd7a7acf2 Network Status: Compose notification icon
... also in Media and Mail servers.

Change-Id: I9a95dc289446ba0dbf138e29cbd6d0b75e6b5ddc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8707
Reviewed-by: waddlesplash <[email protected]>
2024-12-23 17:38:33 +00:00
John Scipione 7e317d9b51 Notifications: Compose size based on font size
Make arrow and close button size font-sensitive.

Compose default window width based on font size.

Eliminate kCloseSize, kEdgePadding, kSmallPadding, kExpandSize
and kPenSize.

Eliminate NotificationView::_DrawCloseButton() in favor of calling
AppGroupView::DrawCloseButton().

AppGroupView::CloseButtonSize() method used in NotificationView.

Eliminate IconSize() from window and view parameter, get icon (and size)
from notification in the view.

Only move text down a line if title is set.

Change-Id: I53654c117bee634d3d8bddf6bf766577bd55b9a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8706
Reviewed-by: waddlesplash <[email protected]>
2024-12-23 17:38:33 +00:00
John Scipione 8e29e4e3e3 Tracker: Change "multiple selections" => "# selected" in Find window
... for example "2 selected" instead of "multiple selections".
Set minimum volume menu field width to "99 selected".

Refactor ShowVolumeMenuLabel() to have multiple selections once.

Change-Id: I5a2126972d3b93e7dd98ca631606302a59546f53
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8151
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-12-23 09:44:41 +00:00
John Scipione 4b27f67f1a Appearance: Redo FontSelectionView to update text color
FontSelectionView was not getting added to the view hierarchy and
thus was not receiving the B_COLORS_UPDATED message when the colors
changed. This was because we wanted to build the grid all at once.
Instead build the grid inside each of the FontSelectionView's and
set the first column to the longest string afterwords so everything
lines up.

This updates the text view colors when the font changes. The rest
of the changes are to fix the view hierarchy so that we don't need
to explicitly call MessageReceived() on the FontSelectionView to
get receive B_COLORS_UPDATED.

Change-Id: Ice6ff0b8a95d522c9994b6b873fac10cf5f71ea4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8246
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-12-22 19:22:44 +00:00
John Scipione c7c5de0f79 Appearance: Use BLayoutBuilder instead of BGroupLayoutBuilder
Rename GetPreviewBox() to just PreviewBox() matching WebPositive.

Change-Id: I378a76bc3d2742273cb5cfad4863e377103786cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8245
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-12-22 19:22:44 +00:00
John Scipione 512a94bc18 BTextView docs: Document GetFontAndColor() and SetFontAndColor()
Change-Id: Ie284c63690e955d7cfae7e9e66949a63205e8e31
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8270
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-12-21 17:32:52 +00:00
John Scipione 10b1abbfde Tracker: Cancel type-ahead filtering on esc
Otherwise esc closes the file panel.

Differentiate between type-ahead and ref filtering in pose view
which is why this was not working in e.g. Expander a ref filter
was set so filtering was also set. We only want to cancel
type-ahead filtering on esc, not ref filtering.

Refer to 'ref filtering' as simply filtering e.g. IsFiltering()
and refer to type-ahead filtering explicity when that is meant.
Rename methods and variables to make it clear whether we're
referring to ref filtering or type-ahead filtering.

If we are ref filtering fill out the filtered pose list again
after stopping type-ahead filtering so that we don't get an empty
file panel in e.g. Expander on esc.

Fixes #13151

Change-Id: I96faf98c3b68d3bcb3d3892c3511ae2449c2f8a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8689
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-12-18 18:55:05 +00:00
John Scipione bd01f3f156 Tracker: Style fixes related to #13151
Some 100 char fixes
Put looper in a variable and use it a few times
Remove ASSERT statements, we B_DISPATCH_MESSAGE if NULL.
Refactor command modifier key code to use a nested switch
Explict comparisons to NULL

Change-Id: I068a0123461290731b4b5388b802bb4cc7bb2455
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8688
Reviewed-by: waddlesplash <[email protected]>
2024-12-18 04:24:26 +00:00
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