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]>
* 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]>
... 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]>
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]>
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]>
... 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]>
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]>
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]>
... 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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
... but extending vertically above and below the list view.
https://www.haiku-os.org/legacy-docs/bebook/BListView_Overview.html
"BListView provides an autoscroll feature: There's an invisible area
about 25 pixels high both above and below the list view; if the user
clicks inside the list view and then drags into this autoscroll area,
the contents of the list will scroll in the direction of the mouse."
Instead of 25px scroll vertically without limit because scrolling
speeds up as you move the mouse cursor further away.
Change-Id: I52296beb2b0173fc5c909255163e8725e99c2b6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7244
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
... and others and double check for valid items on MouseMoved().
Bail out if drag item is invalid instead of deselecting.
Make sure that the item is valid before deselecting it.
Fixes#18707#18716
Change-Id: Ic115f713f2aef7dfebafd23bc3107106b9128b8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7243
Reviewed-by: waddlesplash <[email protected]>
Create TrackerDefaults.h to share default setting values between
TrackerSettings.cpp and SettingsView.cpp instead of duplicating
the default value in both places.
There is now one source of truth if we ever want to change a
setting it won't cause regressions to the Defaults and Revert
button state.
TODO Does not yet include Disk auto-mount settings.
Add HideDotFiles to the defaultable list for Windows settings
and make its default false (was true in some places).
Fix issues with the Defaults button not enabling Enable type-
ahead filtering and Generate image thumbnails as it should.
Move default color constants to TrackerDefaults.h, remove TODO.
Rename kSpaceBarAlpha to kDefaultSpaceBarAlpha matching rest.
Create RGBTOHEX(c) macro to convert rgb_color to a (hex) number
for HexScalarValue to set the default space bar colors.
Saving these old hex values in the commit message:
UsedSpaceColor: 0xc000cb00
FreeSpaceColor: 0xc0ffffff
WarningSpaceColor: 0xc0cb0000
Reorder setting to match display order.
I've gone way over 80 in TrackerSettings and SettingsViews due
to long variable names.
Change-Id: Iafd6dfc5e738562d73967558e1f151fc7fed5866
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7196
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Fix _DuplicateKeys() conflict check for Caps Lock to ignore right side.
- Create kUnset constant set to 0 so it's clear what's going on.
- Create kDisabled constant set to -1 for that case.
- Declare loop variables one time out of loop scope, uint => int for -1.
Fix _MarkMenuItem() warnings icon check. We should get a yellow warning
icon if your left and right modifiers don't match (except on Caps Lock).
Create an _UpdateStatus() method that calls the other methods we need.
Reverse the placement of the Revert and Cancel buttons. Cancel goes just
to the left of the OK button and Revert goes all the way left.
Restore _HideShowStatusIcons(), this is used to push the menu fields
over when there is no conflict. _ToggleStatusIcon() convenience method.
The key role is called "Caps Lock" not just Caps. Method and variable
names are fine, but the " Lock" part is important in the label. Also use
"Caps Lock key" instead of just "Caps Lock" for the menu field value.
We use " key" at the end for the other cases to differentiate them from
the role label.
Minor nitpicks:
- Change comment variable name to label. I understand that it says
B_TRANSLATE_COMMENT, but it's a label, the comment is for i18n.
- Fix same method declaration style, and in header.
- Add 2 new lines after pragma instead of 1
Change-Id: I194e69486310a249d0ef2d5d5977ae69954e9a27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7179
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Multi-select lists may also auto-scroll on drag now as well.
Document ScrollTo(index). Give Scrolling its own section.
Change-Id: I36284a28376a01bafd23ddb30162fc786fb41521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7213
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Create SysInfoDragger class and override its MessageReceived() method
to redraw the target view when draggers are shown or hidden.
Check that fDragger->AreDraggersDrawn() is turned on before drawing
the border in the SysInfoView::Draw() method.
Change-Id: I8de1acafe52319ae0f4ed1d91eec2e9c0ad2cb9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7191
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
... you have lying around on your Desktop that did not get updated
correctly based on changes that have been made since the replicant
feature was introduced.
Do not archive class members in Archive(). Remove SysInfoView
archive constructor. Recreate replicants fresh. No saving to lists
and restoring.
Maintain bottom right corner whenever replicant is resized by
creating _ResizeBy() and _ResizeTo() methods. Since we're starting
over with replicants, this only happens when the uptime wraps.
Fix box height issues, was a bit too tall.
Change-Id: I464fc09a6f86bc88dc09007c9356d2faac340e77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7189
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
No horizontal (or vertical) scrolling allowed if the text rect is
inside the view rect in x (or y).
This fixes issues with right-aligned text views getting scrolled
within bounds becoming left-aligned text views. Prevent scrolling
so that this cannot happen unless text is outside the view.
You can still get DeskCalc to be in a scrolled over no-longer-
right-aligned state by scrolling and resizing repeatedly, but
it's better than before and it is at least fixable. This is most
likely a bug in DeskCalc.
This also fixes issues not being able to scroll all the way right
after scrolling left dragging with the mouse.
Do not set any limits in _PerformAutoScroll(), all limits are set
by the code that does the keyboard handling. Set x and y and call
_ScrollBy();
Update limits set in _ScrollBy() to accommodate both keyboard
and mouse (taking from mouse and using on keyboard as well).
This unifies keyboard and mouse scroll limits in x and y.
Change-Id: I0dd24ce03f9b95651bcee4e190564b77f0343863
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7161
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
... exception to sentence case rule, also Scroll Lock and Num Lock.
Capitalize Right/Left Shift, Control, Option and Command as well.
Change-Id: I65b85eb580fe8cd06664b1bc230ac6aef15d6487
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7182
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
private convenience methods to calculate the text view width and
height with insets and the text rect width and height without
insets respectively.
Also add _ViewRect() and _TextRect() methods for completeness,
but they are not currently used.
Change-Id: I0582bc93a0a3a6820bbb2262a1d726457309ab9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7162
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
U+232B Erase To The Left
U+2326 Erase To The Right
Special case B_DELETE so we don't have to fill out kUTF8ControlMap
with NULLs to get to the last char of the ASCII table at 0x7f.
Lowercase the A in the B_SPACE hex string matching other cases.
Change-Id: Ia5d793112ae8063dfe58366c9dd10d6e616af350
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7177
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
A version of this feature was originally implemented in hrev50495
that allowed you to scroll through a list of list items while the
mouse was held down updating the selection as you went.
This feature was removed when we switched to selecting on mouse up
in hrev52062 and was never reimplimented when we switched back to
selecting on mouse down in hrev52121.
In BeOS R5 as you scrolled through a single-selection list with the
mouse button held down the selected item appeared to change, but
the selection didn't actually update until you released the mouse
button. The selection never changes on mouse down, only on mouse
up. You could click on one item then move your mouse off the first
item to a second item releasing your mouse button and it would
select the second item without ever selecting the first item.
In this commit we replicate this behavior with one exception, we
always select on mouse down, but still allow the selection to
change on mouse up.
The big difference between this and the BeOS behavior is that on
BeOS you could only select exactly one item on mouse up, while with
this you can select one item on mouse down and a second item on
mouse up.
ScrollToSelection() in MouseMoved() if mouse button is down and
we are not not dragging. This performs auto-scroll.
Create private _DoSelection() method copied from MouseDown().
Remove Thread.h include that is no longer used.
Fixes#15009 (and doesn't cause regression for #9190#14264#14289)
Change-Id: Icae02b8d37ed281390647504b4efa3d694ea522a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1956
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
... instead of "4096 bytes" (i.e. 1 block).
Set total_blocks to 0 in packagefs_read_fs_info to indicate
that the capacity is 0, this avoids some potential issues
that using 1 or -1 might cause.
In WidgetAttributeText look for volumes with 0 blocks and
set fValueIsDefined to false which displays a "-".
Also replace capacity string with "-" in Get info.
Fixes#10291 the quick and dirty solution to #18567.
Change-Id: I7ff204c9ffd10cf9cc6343fcdd4422c034004004
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7164
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
... when context-click on a volume in Open/Save dialog.
Regresssion introduced in hrev56978. Separator goes with the
Paste item that is not currently added.
Change-Id: Ic9402cae27ed84f15479ee9b9cc1f48fea806efa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7169
Reviewed-by: John Scipione <[email protected]>
Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.
Fixes#18686
Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <[email protected]>
Although I can't reproduce this crash, from the looks of the crash
report something in the CanEditName() method is throwing a
segmentation fault.
If selection count is not 1, don't even try to get the selection,
Edit name is not allowed unless you have a single item selected.
Double check that selected item is not NULL before using it.
I refuse to believe that fSelectionList being NULL is the problem
here, more likely fSelectionList->FirstItem() is NULL and is the
cause of the crash. Bailing out after checking that selection
count is 1 should ensure that FirstItem() is not NULL.
Hopefully fixes#18684
Change-Id: Ib99192178fa6f6d31b389afb47e72c5513e6e1c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7139
Reviewed-by: waddlesplash <[email protected]>
TargetVolumeIsReadOnly() doesn't make sense here because we
know the trash's volume is not read-only, we need to check
that you have a selection to enable Restore. Currently
(since hrev56978) Restore option is always enabled but it
shouldn't be if you have nothing selected.
It would be nice to also check if the restored location is
not read-only because you put something in the Trash then
remounted the volume read-only, but that's too much work.
Fixes yet another regression from hrev56978.
Also missed a delete convenience method call in hrev57402.
Call CanMoveToTrashOrDuplicate() to check if delete is allowed.
This method does a bit more work, it checks if the selection
includes the Desktop, the root volume, or the trash itself
which you are not allowed to delete.
Otherwise the same, this shouldn't make a big difference.
Change-Id: Ie188f25bd969a5aaeec9ff397fa5750872ccf97f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7138
Reviewed-by: waddlesplash <[email protected]>
Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.
This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.
Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.
Fixes#18657
Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <[email protected]>
... and a few minor feature updates.
Create a CanEditName method on PoseView because we were using
subtly different checks in different places to see if allowed
to edit the name or not.
Tint background color of the Edit name text box on read-only
to indicate that the file name cannot be edited (only copied).
Create ReadOnlyTint() method in Utilities and use it here and
in PoseView to set the background color. Eliminate BackTint()
method from PoseView which served a similar purpose.
Add CanMoveToTrashOrDuplicate() convenience method.
Move To Trash, Delete and Duplicate options use same check.
Context menu of selection in file panel gets Duplicate option,
window context menu never did so don't try to enable it there.
Change-Id: I7a82d00ea10f22a7885c2e898a809e1abe9a6b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7122
Reviewed-by: waddlesplash <[email protected]>
If 0 items are selected, check the window's volume instead.
If 1 item is selected, check if the parent's volume is read-only.
If multiple items are selected, consider the entire selection to
be read-only if any item's parent directory in the selection is
on a read-only volume.
You aren't allowed to for example Cut a selection that has an
item on a read-only volume as the Cut operation would not be able
to succeed. However, if all items in the selection are not on a
read-only volume then you may Cut.
For non-query windows assume all selected item's are on the same
volume and only check the first item when multiple are selected.
Fixes#18661
Change-Id: Ib898e54b62558c66aad65d33afd080480e312565
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7120
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Top level "menu" still uses be_plain_font, submenus use menu font.
Window submenus use menu font, but in super-expando mode they use
the plain font since they are on top level.
Change-Id: I704e9baa1ec46d1cbf7b9401ba4e49b5e2dff27c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7041
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Add vector rdefs for shown, hidden, shown switch
and hidden switch icons. Remove unused bitmap
resources. Add window switch vector icons to
artwork.
Create window icon cache in TBarApp and cache the
window icons based on font size.
Fixes memory leak in #18357.
Don't draw off-workspace lines in Switcher, use
switch icon for that instead. Fixes crash reported
in #18359. Position icon and window name better in
Switcher.
Put BarTeamInfo icon parameter last and make it
optional, the icon gets set by caching.
Enable team icon cache and window icon cache.
Fixes#14694
Deskbar: Scale Twitcher icons based on font size
Remove the point ctor parameter and deprecate the
switcherLoc setting by not using or setting it and
leaving it at its default value.
Center window on screen resolution change and
workspace change (as resolution may not match).
Fixes#17924
Change-Id: Ib63cc307f14cda397ffb66ea74091be59e6e5535
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6335
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
... such as virtual directories or read-only media.
Also applies to open/save panels.
Menu items disabled on read-only volumes:
* New >
* Duplicate
* Move to Trash
* Move To >
* Cut
* Paste
Other reasons a menu item is disabled:
* Duplicate, Move To Trash, Cut, Copy, Move to >,
Copy to >, Create link > and Identify require a
selection.
* Paste requires something in your clipboard.
* Edit name requires a single item is selected.
Edit name is permitted on a read-only volume so
that you may copy the name. However the name is
not editable, you may only select and copy.
Pop system folder warning dialog on Edit name
commit instead, this way you won't see the dialog
if you just want to copy the name.
Move "Create link here" option last in the right-
click drag menu. Disable "Move here" if source or
dest is read-only, rest if dest is read-only.
Ignore Paste to virtual directory, (even more)
but permit Edit name.
Allow drag-and-drop to virtual directory but alert
and disable all right-click drag menu items like
other read-only directories.
Tint window backgrounds on all read-only windows
darker, not just on virtual and query folders.
Automatically switch the background color as you
navigate in and out of read-only folders.
Fix highlight color on column resize when background
color is not white. Fix "reverse video" effect so
that the highlight color is the inverse of the
background color. On Desktop however, highlight
color is always black or white.
Do not alter focus in save dialogs after initial
focus on the file name because focus on the pose
view is required for cut/copy/paste to work.
Make Edit Name work in file open/save dialogs and
make Cut/Copy/Paste work while editing file name.
Make Select all work in Edit name.
Duplicate code cleanup:
NameAttributeText::CommitEditedTextFlavor() and
HeaderView::FinishEditingTitle() call common
EditModelName() function in FSUtils.
RealNameAttributeText inherits from
NameAttributeText and calls its inherited
CommitEditedTextFlavor() method.
The alert text is defined in just one place in
FSUtils ShouldEditRefName() instead of three.
Consequently file name changed in the info window
can now be undone.
Change-Id: I3a78960057b8fb42d1f71af2ec3c808754c9b314
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6357
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
When your font size and team icon size is large
enough horizontal mode Deskbar gets cut off.
Compare composed to composed, this restores the icon
size scaling behavior as indended before compose
changes in Deskbar: label is positioned to the right
of the team icon until after the third icon size
notch regardless of your font size.
Change-Id: Ia1d1418cc3b04536a55860d3889d2437c40986cc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6415
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This allows arrow keys, page keys, home, end and the
blinking cursor on selectable views even if they are
non-editable. Input of text characters and backspace
are guarded on editable. Paste remains disabled.
Change-Id: Ifa5ed8673104e9abd51c52d394894aef48243965
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6407
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
... including whitespace, brackets, rename loc to where or
location, add a pragma.
Replace min_c with std::min.
Replace BPoint(0, 0) with B_ORIGIN
Use make_color() function to make static rgb_color objects.
Change-Id: I47a4e5e5f0e7038643baca7539d211350bbb8f20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6404
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Update \since to BeOS R4. This method definitely predates Haiku,
it has existed since at least R4.5 despite not being documented.
Document B_NAME_TOO_LONG return value.
Change-Id: I0816e4e89ae2710f6123e10ee41145a83fdca66f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6363
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
result is being used on VisitReadQueryRequest().
It was not being used on ProcessQueryEvent() though
so leave that off still.
Change-Id: I8fbfbb3edef6ff962237f696fe315b66900b4376
This changes more than just style, put enum values back.
In practice this makes no difference but the change was
unintentional so put it back like it was before.
Change-Id: I46c782c441d72e77a2897683f54ba7fcefbd5b63
Refactor so that ExpandoMenuBar and TeamMenu both call the menu item
TeamMenuItem::HandleMouseDown() method to do the actual work and then
send a message to cleanup.
Fixes#17761
Change-Id: I0e13e5fc6c90236936120ff0dda1246123576d37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6311
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Note that this only affects the leaf and team menu item icon size
as we do not actually display any bold text here and this does not
cause any menu text to display as bold anywhere in Deskbar.
The reason to use bold font is because the leaf/team menu is set
to the same height as the window tab and the window tab is bold.
Fixes#17913
Change-Id: I8fd23e30e9a28e6aa24b4726c73863b9d0370010
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6297
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Automation <[email protected]>