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]>
Tracker creates a drag bitmap containing the selection being dragged.
There is a size limit if the selection is too large to avoid moving a
huge bitmap around.
There were two problems with the way this was done:
- The smaller rectangle was always centered on the cursor, even if that
was near the edge of the selection being dragged. In that situation,
most of the drag bitmap would end up being empty. Instead, move the
rectangle to align it with the edges of the selection if it goes
outside them. This makes sure we always use as much of the drag
rectangle as possible for useful data.
- Moreover, there was a regression on the rendering of the
"fade" at the edge of the rectangle. This is a transparency gradient
that should be at the edge only, to indicate that the drag bitmap has
been truncated, and that more (invisible) things are also being
dragged. In hrev58665, this transparency gradient was changed to cover
the entire width and height of the dragged bitmap, instead of just the
edge. This lead to most of the text being almost invisible in a lot of
cases. Change the code to use a gradient only near edges again.
Fixes#19429.
Change-Id: I395fda191dc61732e4bdc5287a09882cdc2b5f55
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10177
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: waddlesplash <[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]>
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]>
* 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]>
This should be much more efficient in the kernel.
Live update of windows when files change elsewhere still seems to work.
Queries and "Open with" still use per-node monitoring at present, but
all others now use only the single monitor for directories.
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]>
* 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]>
* 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]>
Since BObjectList is a template class, this only breaks ABI where
BObjectList was exposed in public methods, and even then it's only
a name mangling break and we should be able to add compatibility
methods if necessary.
(The old "bool owning" member variable is left intact for ABI
compatibility, for the moment, though it's otherwise unused now.)
Tracker's PoseList is the only remaining type that has a "bool owning"
switch in the constructor rather than template parameters.
This should significantly improve the output of static code analysis
tools that previously detected list operations as causing use-after-frees
and double-frees, as well as make code maintenance easier by making it
easier to determine what list owns (or does not own) an object.
It should also be a minor performance optimization, since the branches
for calls to delete/free should now be optimized out altogether.
Still boots to desktop and Tracker, Deskbar, Debugger all tested
and verified as working.
Change-Id: If2a24a6f0d22e7a506ef554fcfdd328907279ed4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8915
Reviewed-by: waddlesplash <[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]>
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]>
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]>
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]>
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]>
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]>
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]>
... 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]>
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]>
This commit introduces folder filtering to the Find Panel and associated
results window.
--> Features:
--> Directory Selection: Users can select directories using the
"Select a Directory..." option, now available in the same menu
as volume selection.
--> File Panel Integration: Upon selecting this option, a File
panel will appear, displaying only folders or symlinks to
folders for selection.
--> Folder Filter Management: Selected Folders are shown in the
same menu, with the corresponding menu item marked. Clicking on
the menu item removes the folder filter.
--> Recursive Search: The folder filters are combined using the
OR method. Results will show items from any selected folder,
recursively checking all subfolders.
--> Bug Fixes
--> Resolved an issue with the saving functionality when resetting
volumes or loading a query.
Change-Id: I8eaab6ad8ebd3de09944a8bcf03f100c451225ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7845
Reviewed-by: Niels Sascha Reedijk <[email protected]>
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]>
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]>