summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2022-09-01LibGUI: Disable increment/decrement buttons on SpinBox based on valueTimothy Slater
When the value for a SpinBox equals the max, disable the increment button. Functionally, clicking the button doesn't do anything because the set_value() clamps the value to min/max and updates the textbox. However it is still nice to indicate to the user that they've reached the max. Same goes for minimum value and the decrement button.
2022-09-01LibGUI: Improve SpinBox usabilityTimothy Slater
Previously the value of the SpinBox is re-evaluated after every change to the TextBox control. This leads to very unintuitive behavior such as the user deleting the contents of the box and it having no visible effect. This happens because the TextBox no longer has a valid number and so gets reset to the current m_value of the SpinBox. By defering the update of to the SpinBox value until focus leaves the control we provide a much more intuitive experience with the text box. We do still validate when a user types something that it parses to an int. If it does not we delete the most recent character. This in effect prevents non-numeric numbers from being entered. Upon losing focus the value will be checked. If empty we set the SpinBox value to the minimum allowed value.
2022-08-31LibGUI: Don't accept drag events in AbstractView if it's not editableKarol Kosek
With a new DragCopy cursor icon being used on accepted events, this caused a 'false assumption' that everything can be dropped into AbstractView. This will now only happen if the View is editable, which still isn't perfect, but at least the Settings app will no longer change cursors. Also note that we won't get "drag move" events as the comment below says, which disables automatic scrolling when dragging an element.
2022-08-31WindowServer+LibGUI: Change cursor icon if DragEnter event was acceptedKarol Kosek
2022-08-31FileManager: Navigate to parent dir when current location is removedAdam Jakubek
When the location currently displayed in FileManager is removed, find the nearest existing parent path and open it in the window. Without the fix, the FileManager window remained in the deleted directory. Changing the path in 'DirectoryView' object will automatically update other components in the FileManager (breadcrumb bar, directory tree view).
2022-08-31LibGUI: Fix assertion when handling removal of FileSystemModel's rootAdam Jakubek
This commit fixes FileSystemModel behaviour when the root path of the model has been deleted. In this case, the model index resolved for the root path is invalid and passing it to 'begin_delete_rows' would trigger assertion failure. Instead of deleting all children rows one by one, we simply invalidate the whole model.
2022-08-28LibGUI: Make CommandPalette and EmojiInputDialog passive modalsthankyouverycool
Now they can be dismissed by clicking anywhere outside themselves, including on their parent windows. This is a better default for them since they don't have title bars to flash, and it's more consistent with other frameless windows in the system.
2022-08-26LibGUI: Add visual line mode to VimEditingEngineRobbie Vanbrabant
Applications using the Vim emulation engine now support line-wise text selection. We already have support for character-wise text selection, by pressing `v` from normal mode. However now can also trigger line-wise text selection by pressing `shift+v` from normal mode, and then using vertical motion commands (e.g. `j` or `k`) to expand the selection. This is a standard vim feature. In visual line mode the following operations are supported: * `escape`: back to normal mode * `u`: convert to lowercase * `U`: convert to uppercase * `~`: toggle case * `ctrl+d`: move down by 50% of page height * `ctrl+u`: move up by 50% of page height * `d` or `x`: delete selection * `c`: change selection * `y`: copy selection * `page up`: move up by 100% of page height * `page down`: move down by 100% of page height Notably I didn't implement pressing `v` to go to regular (character-wise) visual mode straight from visual line mode. This is tricky to implement in the current code base, and there's an alternative, which is to take a detour via normal mode.
2022-08-26LibGUI+Taskbar+WindowServer: Prevent minimization when blockedthankyouverycool
This was intentionally enabled with WindowModes as a new Taskbar convenience, but on second thought, it doesn't add up visually. Taskbar buttons show blockers' context menus when available, which is a bit confusing when the window isn't visible. The modeless window's disabled context menu options and inactive title bar also contradict the button. So, this patch reenables the restriction for now. Blocking modals you don't want to answer to immediately can still be tucked away on another workspace.
2022-08-25LibGUI+Taskbar+WindowServer: Remove mode and parent methods from Taskbarthankyouverycool
Taskbar only needs a modeless parent and the activity state of the modal chain to update buttons.
2022-08-25LibGUI+WindowServer+Apps: Replace Accessory Windowsthankyouverycool
with the CaptureInput WindowMode. This mode will serve the same function as accessories: redirecting input while allowing parent windows to remain active.
2022-08-25LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindowsthankyouverycool
with the RenderAbove WindowMode. This mode will ensure child windows always draw above their parents, even when focus is lost. RenderAbove modals are automatically themed the same as the old ToolWindows. Fixes ToolWindows rendering above ALL normal windows, regardless of parent. We can't rely on WindowType to create these sort of effects because of WindowManager's strict display hierarchy.
2022-08-25LibGUI+WindowServer: Introduce WindowModesthankyouverycool
Previously, Windows only understood blocking modality: Windows were either modal, i.e., in a blocking state, or not. Windows could also be set as Accessories or ToolWindows, attributes which technically applied modes to their parents but were implemented ad hoc. This patch redefines these modal effects as WindowModes and sets up some helpers. This will let us simplify a lot of modal logic in the upcoming patches and make it easier to build new modal effects in the future. Windows can now set 1 of 5 modes before reification: -Modeless: No modal effect; begins a new modal chain -Passive: Window joins its modal chain but has no effect -RenderAbove: Window renders above its parent -CaptureInput: Window captures the active input role from its parent -Blocking: Window blocks all interaction with its modal chain States like fullscreen and tiling are dynamic and don't alter behavior in modal chains, so they aren't included.
2022-08-25LibGUI: Remember size and position of hidden Windowsthankyouverycool
And don't reset windowless rects on resize events. Fixes child windows reappearing at [0,0] and with the wrong dimensions after being hidden.
2022-08-25Apps+Demos+Dialogs: Remove unnecessary minimum window sizesthankyouverycool
The new layout system conveniently calculates these for us now. In the case of Mandelbrot where it needs to be overriden, make sure to disable obey min widget size first. In EmojiInputDialog's case, the window needs to be resized instead to center correctly.
2022-08-25LibGUI+WindowServer: Initialize minimum window size to zerothankyouverycool
And remove unnecessary workarounds to the old limit of {50, 50} and the cautious but arbitrary limit of {1, 1} for other WindowTypes. Null rects are already the default when calculating minimum window size and are the least restrictive but valid value. Also returns early during minimum size calculations for frameless windows, and verifies against negative minimum sizes and failure to disable widget min size before setting a minimum window size. Layout automatically overrides this setting each relayout otherwise.
2022-08-23LibGUI: Call on_segment_change handler from on_{click,focus_change}networkException
The on_segment_change handler introduced in a00fa793b37550a8b44122192346eeeb1d692bf9 was only getting called by programmatically setting the segment, not by clicking a button or using tab navigation.
2022-08-23LibGUI: Don't call on_segment_change handler if the index did not changenetworkException
This patch makes the handler's behavior closer to what can be expected from it's name by not handling set_selected_segment if the segment is already selected.
2022-08-22LibGUI: Clear selected index of Breadcrumbbar if segment is removedJannis Weis
If the segment corresponding to the selected index is removed the index is no longer valid.
2022-08-22LibGUI: Add on_segment_change handler to BreadcrumbbarJannis Weis
This allows programs to respond to any selection changes of the Breadcrumbbar, not just ones made by clicking one of the buttons.
2022-08-18LibGUI: Make Breadcrumbbar remember the selected segment indexAndreas Kling
We had a selected_segment() accessor, but the member it returned was never actually updated.
2022-08-18TextEditor: Change cursor when reaching the ruler areaThomas Symalla
Noticed that mouse-overing the ruler area in the TextEditor does not change the cursor to the default cursor, instead, the beam cursor is used, which does not look nice. This PR extends the mousemove event and introduces a new set_editing_cursor() function that takes care of setting the cursor for the editor area.
2022-08-16LibGUI: Don't let widgets hide tooltips they didn't showDavid Smith
Widget::handle_leave_event() hides the tooltip if one is shown. That's usually fine and hides the widget's tooltip, but it can happen that another widget managed to show a tooltip after the Leave event was triggered and before it's processed. Thus change handle_leave_event() to only hide the tooltip if it was show by the widget. Fixes the case where this could happen in the flame graph in Profiler when moving the mouse over the tooltip window itself #14852.
2022-08-16LibGUI+WindowServer+DisplaySettings: Add Tooltips to SystemEffectsthankyouverycool
Tooltips can now be toggled on and off system-wide.
2022-08-16LibGUI: Put DragOperation dbgln() behind DRAG_DEBUGthankyouverycool
2022-08-16LibGUI: Retain the active input tracking widget's cursorAndreas Kling
Until the tracking stops, we want to keep displaying the same cursor.
2022-08-15LibGUI: Programatically draw table header sorting arrowsTimothy Flynn
These arrows were previously drawn using the code points U+2B06 and U+2B07. The .png files for these emoji were removed in commit bfe99eb and added to the Katica Regular 10 font in commit cf62d08. The emoji were not added to the bold Katica variants that are used by the table header view. The effect is that a "?" replacement character was rendered. Instead of rendering the emoji, we can draw the arrows programatically, like we do in other GUI components (e.g. the scrollbar).
2022-08-14LibGUI: Initially disable the "Apply" button in SettingsWindowAndreas Kling
We'll enable it if/when the user modifies something.
2022-08-14Base: Launch NotificationServer at session start-upLucas CHOLLET
2022-08-14LibCore+LibIPC: Recognise %uid in pathLucas CHOLLET
This patch allows to insert "%uid" in `IPC_CLIENT_CONNECTION` declaration and in SystemServer's ini files. This pattern is replaced then replaced by the UID of the owner of the service. It opens a path for seamlessly managed, per-user portal.
2022-08-14LibGUI: Allow GlyphMapWidget to highlight modified glyphsSam Atkins
This makes modifications in FontEditor more visible, both so you know what you've changed, and for taking a handy "here's what's changed" screenshot for a font PR. :^) The background color for new glyphs is green, modified glyphs is blue, and deleted glyphs is red. The changes persist until you load a new font file, so you can continue saving your work as you go and still be able to take a convenient screenshot at the end. I didn't feel like this one use was enough to add 3 new color roles to themes, so to make this look decent on dark themes, it detects if the theme is marked as dark, and uses darker colors for the highlights which look nice with a light text color.
2022-08-14LibGUI: Avoid too large tooltip when switching to shorter textDavid Smith
The tooltip window didn't resize when setting a shorter text, or moving to a widget with shorter text, so it had extra space on the sides. Fix by allowing the window to resize without obeying the minimum size of the (previous) tooltip.
2022-08-09LibGUI+LibGfx: Let Desktop::the() set widget effectsthankyouverycool
Scrolling can now be set Coarse or Smooth system-wide, Splitter knurls and Tab accents toggled on and off, and Menu flashing disabled.
2022-08-09LibGUI+WindowServer: Create IPC calls for passing SystemEffectsthankyouverycool
SystemEffects are sent to the WindowManager through set_system_effects() and broadcast to Desktop clients with update_system_effects(). WindowManager is reponsible for saving, loading and rebroadcasting effects from WindowServer.ini on config changes.
2022-08-09LibGUI: Let Desktop:the() manage SystemEffects inside LibGUIthankyouverycool
These settings might well ultimately be factored into a dedicated settings manager, but until then, a charitable interpretation of Desktop::the() as the desktop environment will suffice.
2022-08-09LibGUI+WindowServer: Add a SystemEffects wrapper and helpersthankyouverycool
SystemEffects provides a tidy way to work with system-wide visual options passed through IPC.
2022-08-08LibGUI: Correct cursor index during mouseup_eventMatthew B. Jones
Previously, during a m_might_drag mouse_up event, we were updating the selection directly, which caused the selection to be accurate but the location of the cursor index to be stale/incorrect. The side effect of this is then future events may point to the wrong index. Instead, call the set_cursor function with SelectionUpdate::Set, which handles both updating the cursor index as well as the selection index.
2022-08-05LibGUI: Register "bitmap" GML property for ImageWidgetthankyouverycool
2022-08-05LibGUI+Applications: Govern Splitter resizing by opportunistic growththankyouverycool
This patch replaces the concept of fixed resizees with opportunistic ones which use the new SpecialDimension::OpportunisticGrow UISize. This lets us simplify splitter resize code and take advantage of the layout system's automatic calculations for minimum size and expansion. Functionally the same as before, but fixes Splitter's unintended ability to grow window size.
2022-08-05LibGUI: Calculate maximum primary size for Splitter resizeesthankyouverycool
2022-08-04LibGUI: Let Toolbars collapse into an overflow menuthankyouverycool
Previously Toolbars were governed by a strict minimum size which guaranteed all actions remained visible. Now, if set collapsible, extra actions will fold into an overflow menu on the Toolbar.
2022-08-04LibGUI: Let Buttons set their menu popup positionthankyouverycool
The previous ButtonStyle::Tray conditional was a hack for Statusbars.
2022-08-04LibGUI: Remove button padding on Toolbar constructionthankyouverycool
And assume 24x24 button sizes by default. There currently aren't any toolbars with custom button sizes, but if the need arises, they can always determine their own padding.
2022-08-04LibGUI: Remove useless frame members from Toolbarthankyouverycool
Frames had no effect within Toolbar and are now superceded by ToolbarContainer.
2022-08-02WindowServer+LibGUI: Remove awkward roundtrip for set wallpaper responsenetworkException
Previously we would wait for a separate message confirming that a wallpaper got set instead of just calling a synchronous api. I'm guessing that this was a limitation of the IPC system when WindowServer got ported to using it. This patch removes the SetWallpaperFinished message and updates the set_wallpaper api to synchronously return a success boolean.
2022-08-01Userland+Base: Make the window titlebar font configurable separatelyAndreas Kling
Instead of defaulting to "bold variant of the system default font", let's allow the user to set any font they want as the titlebar font.
2022-08-01LibGUI: Allow Tab key to switch focus from non-editable GUI::TextEditorAndreas Kling
2022-08-01LibGUI: Expose GUI::Button's "default" property to GMLAndreas Kling
2022-07-26LibGUI: Move tooltip position up 4 pixels to prevent cursor pop-undergbowser3@gmail.com
2022-07-25LibGUI: Make Checkbox constructor protectedkleines Filmröllchen