Commit Graph

828 Commits

Author SHA1 Message Date
Jean-Paul Balabanian
d47573eba6 LibGUI: Add missing altgr() modifier key 2022-01-08 11:50:26 +01:00
Filiph Sandström
645712be3b EmojiInputDialog: Ensure that all buttons are equal width
Previously we only set the min size which meant that some emoji buttons
was larger than others :^)
2022-01-07 05:49:12 +03:30
Andreas Kling
a433727961 LibGUI: Avoid double hash lookup in ModelSelection::add() 2022-01-06 21:39:51 +01:00
sin-ack
2cfd7cbeda LibGUI: Update the AboutDialog copyright year :^) 2022-01-06 21:25:21 +01:00
Marcus Nilsson
cecbed467b LibGUI: Move rotate cw/ccw to CommonActions
The rotate clockwise/rotate counterclockwise actions can be added to
CommonActions since they are repeated in FontEditor, ImageViewer and
PixelPaint. This keeps the shortcuts and icons consistent across
applications.
2022-01-06 21:25:02 +01:00
martinfalisse
8eb8949d9c LibGUI: Calculate row position for scroll into view
When a user is navigating a table view with arrow keys and a row is
outside of the current view, then scroll_into_view is called, and the
position of the rectangle passed to this should take into account the
column headers.

This can be seen making more pleasant the navigation in the System
Monitor in the Processes view, for example.
2022-01-06 17:48:04 +01:00
martinfalisse
938380e88b LibGUI: Table View navigating with arrow keys continuity after update
When a user is navigating a table view with arrow keys and a row is
outside of the current view, then scroll_into_view is called, and the
position of the rectangle passed to this should take into account the
column headers.

This can be seen making more pleasant the navigation in the System
Monitor in the Processes view, for example.
2022-01-06 17:48:04 +01:00
Andreas Kling
2375e1bcda LibGUI: Rename ModelSelection::remove_matching => remove_all_matching
Let's be consistent with how Vector, HashTable and HashMap names these.
2022-01-05 18:57:14 +01:00
Andreas Kling
c6bcd0dfe4 LibGUI: Use HashTable::remove_all_matching() in GUI::ModelSelection 2022-01-05 18:57:14 +01:00
Mathieu PATUREL
c8addf1a5e LibGUI: Consume initial spaces when going to next/prev word break
This impacts text editors' ctrl+left, ctrl+shift+right, ctrl+backspace,
etc..

For example, consider the text "Hello world   |", pressing
ctrl+backspace each time.

Before: "hello world   |"
        "hello world|"
        "hello |"
        "hello|"
        "|"
 After: "hello world   |"
        "hello|"
        "|"

Note that this breaks a nice symmetry. Doing ctrl+left and then
ctrl+right doesn't necessarily get you to the same place like it use to.

Before: " hello |"
        " hello| "
        " hello |" // same as initial
 After: " hello |"
        "|hello "
        " hello| " // different from initial
2022-01-05 14:18:44 +01:00
thankyouverycool
d375904978 Base+LibGUI: Add unique "Save As" icon
Icon by: Mustafa Quraish <mustafaq9@gmail.com>
2022-01-05 13:58:18 +01:00
Andreas Kling
0c09617b48 LibGUI: Don't show "last saved" information for never-saved documents
When showing the "unsaved changes" dialog for an empty path, we should
say "last saved at ..." since that would be a lie.
2022-01-04 21:49:44 +01:00
Andreas Kling
e5e109a556 LibGUI: Add optional unmodified timestamp to "unsaved changes" dialogs
This allows us to show "last saved N seconds ago" when asking the user
what to do. :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
c4cc796f86 LibGUI: Make GUI::UndoStack remember time it was last set to unmodified
This can be used to determine how much time has passed since a document
was saved. :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
8e336d3404 LibGUI: Add GUI::MessageBox::ask_about_unsaved_changes()
This is a static helper function for asking the user what they want to
do about unsaved changes. It behaves as a standard Yes/No/Cancel box
with text and buttons tailored to the typical unsaved changes use case.
2022-01-04 21:49:44 +01:00
Andrew Kaster
c8cfd6661a Userland: Resolve -Woverloaded-virtual in LibGUI and SoundPlayer
Enable the warning project-wide. It catches when a non-virtual method
creates an overload set with a virtual method. This might cause
surprising overload resolution depending on how the method is invoked.
2022-01-04 07:51:31 +00:00
martinfalisse
452150c632 LibGUI: Bring entire cell into view after auto scroll into view
On account of row and column headers, when a user navigates to
a cell (for example in the spreadsheet application) that is
outside of the view, the cell is not properly aligned and so
is partially cut-off. This fix takes into account the row and
column headers when calculating the Rect to pass to the
scroll_into_view function.
2022-01-03 15:49:07 +01:00
Andreas Kling
950784b5a6 LibGUI: Increase vertical padding on GUI::IconView item labels by 2px
Let's give the text a tiny bit of breathing room.
2022-01-02 18:08:02 +01:00
Filiph Sandström
35dac843b4 Theming: Add alignment section
This commit removes the IsTitleCenter property and replaces it with
the TitleAlignment property that supports "Left", "Right" & "Center".
2022-01-01 22:51:53 +01:00
Ben Wiederhake
13acf603d8 LibGUI: Avoid unnecessary copies in FileIconProvider 2022-01-01 15:40:39 +01:00
networkException
b46ea5158d WindowsServer+LibGUI: Avoid getting color under cursor outside screen
This patch fixes a crash in ColorPicker caused by the ColorSelectOverlay
trying to request the color for a pixel outside the screen rect.
2022-01-01 14:32:11 +01:00
Young-Jin Park
9d74659f3b LibGUI: Fix leading whitespaces when text is wrapped
This commit should fix a bug where using leading whitespaces when a line
is wrapped results in a crash. Now it should correctly highlight the
leading whitespaces even when the leading whitespaces are longer than a
line.
2021-12-30 14:34:01 +01:00
Elyse
173a84a2ef LibGUI+SoundPlayer: Use 'decrease_slider_by_page_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() - page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
0d660b27ae LibGUI+SoundPlayer: Use 'increase_slider_by_page_steps()'
This method allow us to avoid repeating the pattern
'set_value(value() + page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
8d1fb299b1 LibGUI+LibWeb: Use 'decrease_slider_by_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() - step() * step_number)'.
2021-12-30 14:31:50 +01:00
Elyse
cee4e02134 LibGUI+LibWeb: Use 'increase_slider_by_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() + step() * step_number)'.
2021-12-30 14:31:50 +01:00
Elyse
086615535f Everywhere: Use 'decrease_slider_by()' method from AbstractSlider
The same idea as 'increase_slider_by()', it helps us to avoid repeating
the pattern 'set_value(value() - delta)'.
2021-12-30 14:31:50 +01:00
Elyse
d53e1fa1fa Everywhere: Use 'increase_slider_by()' method from AbstractSlider
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
2021-12-30 14:31:50 +01:00
Elyse
8b8f404146 LibGUI: Add movement methods to AbstractSlider
These methods give us a simple way to move up and down the slider,
without needing to repeat the 'set_value(value() + some_value)'
pattern that multiple applications and libraries use.
2021-12-30 14:31:50 +01:00
Maciej
cd92b73845 LibGUI: Convert INISyntaxHighlighter to east-const 2021-12-30 14:12:39 +01:00
Maciej
1f7e363b74 LibGUI: Use consistent naming scheme in INILexer 2021-12-30 14:12:39 +01:00
Maciej
18d489faec LibGUI: Handle '#' comments in INILexer
They are supported by LibCore's ConfigFile but were not higlighted.
2021-12-30 14:12:39 +01:00
Sam Atkins
f6633a1026 LibGUI+Userland: Make SortingProxyModel::create() return ErrorOr
Unfortunately, most of the users are inside constructors, (and two
others are inside callback lambdas) so the error can't propagate, but
that can be improved later.
2021-12-24 05:11:52 -08:00
FrHun
86363ffe6e LibGUI: Add visual clue to Scrollbar gutter
This adds a visual clue to scrolling by clicking on the Scrollbar
gutter. This gives the user a hint that scrolling will continue in the
direction of the darkened gutter, until the mouse is released.
It is inspired by very similar behavior on old windows.
2021-12-23 23:19:42 -08:00
Andreas Kling
186de9fe4d LibGUI: Make GUI::try_create_default_icon() tolerate single-size icons
Some icons only exist in 16x16 and we should still allow them to be
loaded via the LibGUI default icon system.

This patch also reimplements GUI::default_icon() as a MUST() wrapper
around try_create_default_icon().
2021-12-20 21:13:42 +01:00
PerikiyoXD
ff49285a02 LibGUI: Adjust focus rect for Buttons with icons
Reduced focus rect inflation value for buttons with icons
to match the expected focus rect for buttons without icons.

As mentioned in 'SerenityOS Office Hours / Q&A (2021-12-17)'
2021-12-19 13:39:02 +01:00
Astraeus-
61fed26400 LibGUI: Add ErrorOr wrapper for default icon creation 2021-12-17 13:09:54 -08:00
scwfri
fa94978a7e LibGUI: Add EngineType to EditingEngine classes
This will allow users of EditingEngine classes to determine current type
of EditingEngine (currently either vim or regular).
2021-12-09 21:31:06 +01:00
Sam Atkins
d95e50643e LibGUI: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins
d2024f04bd Userland: Cast unused BackgroundAction::construct() results to void
User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
2021-12-05 15:31:03 +01:00
Martin Blicha
8fb52c6962 LibGUI: Make FilteringProxyModel reference-count its parent model
Before this change, the destructor of FilteringProxyModel
would crash if the parent model had been destroyed earlier.

This unifies the behaviour of FilteringProxyModel with
SortingProxyModel in this respect.
2021-12-02 22:43:54 +01:00
Erik Biederstadt
0cfe446d3f LibGUI: Allow double clicking on tabwidgets 2021-12-01 00:44:26 +03:30
scwfri
dbd40e4c2a LibGUI: Implement vim motions for LeftBrace and RightBrace
In VimEditingEngine, implemented vim motions for Key_LeftBrace and
Key_RightBrace
2021-11-30 10:55:19 +01:00
thankyouverycool
298a6b9937 LibGUI+FontEditor: Allow ComboBox on_change callback to be toggled
When calling set_selected_index() on ComboBox, allow its on_change
callback to be disabled. Fixes FontEditor window state erroneously
switching to modified when initializing between different slopes
and weights.
2021-11-30 10:51:51 +01:00
Andreas Kling
60c132d7d3 LibGUI: Move GUI::SettingsWindow setup out of the constructor
In order to propagate errors that occur during UI setup, we have to move
all that logic out of widget/window subclass constructors. This is a
first attempt at doing that, for GUI::SettingsWindow.
2021-11-28 08:54:22 +01:00
Andreas Kling
56c4f0aff5 LibGUI: Add fallible variants of the GUI::Layout add/insert APIs 2021-11-28 08:54:22 +01:00
Andreas Kling
45844f9338 LibGUI: Make GUI::SettingsWindow::add_tab() return ErrorOr
This allows us to use TRY() when creating settings UI.
2021-11-28 08:10:53 +01:00
Andreas Kling
8359975ff3 LibGUI: Make GUI::TabWidget tab creation APIs take String
Ultimately we'd like the caller to provide a String if possible (instead
of a StringView) as we're going to end up storing it.
2021-11-28 08:10:53 +01:00
kleines Filmröllchen
1e9554145e LibGUI: Add a cancel button callback to settings window tabs
Some settings tabs, like the ones on the upcoming terminal settings,
need to know when the cancel button is pressed to clean up things like
temporary live updates. Therefore, the SettingsWindow::Tab now features
a cancel_settings callback which does not need to be implemented.
2021-11-27 12:45:44 +01:00
Andreas Kling
e623e73f63 LibGUI: Add GUI::Toolbar::try_add_separator()
This is a fallible variant of add_separator() that returns ErrorOr.
2021-11-24 23:07:31 +01:00