Note this is a change to how BeOS R5 and Haiku has always worked.
Drawing dragged poses as selected ensures that the text can be read
even on black on black or white on white because the selection rect
creates contrast.
Lessen contrast by blending with gray when selected and cut, even
more when window is unfocused.
Pose text on Desktop is inverted compared to in a folder by default
so this bug typically occurs when dragging to and from Desktop.
Change-Id: Icb1ee7ccbf9b5e2d8c3a4b89c6b90e19da15c917
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9520
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
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]>
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]>
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]>
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]>
... 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]>
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]>
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]>
(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]>
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]>
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]>
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]>
* 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]>
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]>
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]>
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]>
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]>
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]>
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]>
_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]>
* 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]>
... 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]>
... 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]>
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]>
* 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]>
* 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]>
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]>
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]>
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]>
... 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]>
... 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]>
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]>
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]>