Age | Commit message (Collapse) | Author |
|
Just like the other event handler functions, handle_resize_event()
shouldn't assume that the window has a main widget (which is being
resized in this case).
Fixes #4450.
|
|
on_edit_action
|
|
|
|
Let's make SelectionBehavior a view concept where views can either
select individual items (row, index) or whole rows. Maybe some day
we'll do whole columns, but I don't think we need that now.
|
|
We were always filling the rect behind item texts, even when the widget
had fill_with_background_color() == false.
|
|
It was getting lost in some bogus coordinate conversion math while
trying to constrain unusually long item texts.
|
|
to_content_rect() and to_widget_rect() help you convert rects from one
coordinate space to the other.
|
|
This makes it look nice regardless of wallpaper or background color.
|
|
This is a rather ugly hack just to get app icons to show up in the
FileManager. It would be a lot nicer to embed icons in executables
instead but it's not obvious to me how to do that.
|
|
Instead of symlinks showing up with the "filetype-symlink" icon, we now
generate a new icon by taking the target file's icon and slapping a
small arrow emblem on top of it.
This looks rather nice. :^)
|
|
This gives you a Vector<int> with all the sizes contained in the Icon.
|
|
The dynamic loader is now stable enough to be used everywhere in the
system - so this commit does just that.
No More .a Files, Long Live .so's!
|
|
|
|
This can be used to implement segmented path bars in FileManager and
wherever else wanted.
|
|
If a hook triggers the deletion of the GUI::Button, we would be unable
to proceed in a well-defined manner here, so let's protect ourselves.
This probably needs to be done in a whole lot of places, since GUI
widgets are just ref-counted Core::Objects and running arbitrary code
can mean that they get deleted.
|
|
Instead of TextEditor knowing about the ComboBox button on the right
hand side, we now make ComboBox inherit from GUI::Frame, and make the
inner text editor widget frameless.
This allows us to place the button ourselves inside ComboBox without
any frame artifacts, and TextEditor no longer needs to keep track of
the geometry of that button.
|
|
The focus_dependent_delete_action that sits in the file manager's
toolbar would always remain enabled, even if nothing was selected,
activating it if nothing was selected would then crash the application.
The action is now correctly enabled/disabled, but due to the way
selection works in TreeViews, something is always selected, what really
matters is if the TreeView has something selected, and it has focus.
As it currently stands, there is no way to know when the TreeView's
is_focused status changes. In order for this to work I added a callback
to the Widget class which fires when a widget receives or looses focus.
In that callback, the focus_dependent_delete_action's enabled value is
recalculated.
|
|
|
|
It's just more attack surface, and can be deduced from the format anyway.
|
|
This makes focus policies show up in the inspector which is helpful.
|
|
Sometimes an action should be disabled and the KeyEvent not posted to
the app's event loop nonetheless. In other words the action swallows the
KeyEvent without being activated.
Specific use-case: Terminal's Ctrl+Shift+{C,V}.
|
|
|
|
We need to call waitpid until no more waitable children are available.
This is necessary because SIGCHLD signals may coalesce into one when
multiple children terminate almost simultaneously.
Also, switch to EventLoop's asynchronous signal handling mechanism,
which allows more complex operations in the signal handler.
|
|
Using add() is very slow due to the change notifications.
|
|
When `DontInvalidIndexes` is passed, be optimistic and keep the old
indices when the model validates them.
This is currently fine, as the group of models that use
DontInvalidateIndexes use it as "The old indices are still ok" (there's
a note about this in ProcessModel.cpp).
|
|
This fixes the control key starting an edit on (and inserting a nul
character into) a cell in Spreadsheet.
|
|
...and use `ModelClient::model_did_update()' instead.
This makes AbstractView a ModelClient (which it always was anyway).
|
|
This was accidentally removed in 1c90321.
Fixes #4125.
|
|
|
|
Just log a debug message instead. We still need to actually implement
vertical header context menus, but for now let's at least not crash.
|
|
|
|
|
|
Previously GUI::Actions which were constructed without initializing
m_shortcut could be activated via an invalid GUI::Shortcut.
Steps to reproduce:
It was possible to enable TextEditor's markdown preview by pressing
Ctrl or Alt (Cmd/Ctrl) keys, which should not happen, as this Action
did not specify a shortcut.
This fix should apply to all other cases where actions where declared
without specifying a shortcut.
|
|
|
|
This would undo all commands at once instead of one at a time.
|
|
When clicking empty space (beneath any used lines) in the TextEditor,
the cursor would jump to the start of the last line, rather than the
correct column, or the end of the line where appropriate. This was
because in the for_each_visual_line callback would return
IterationDecision::Continue if the clicked point wasn't in the line's
rect. Thus the callback would continue on each iteration and at the
end, would set the cursor to the default column of 0. To fix this I
added a bool to the callback's signature which tells the callback if
the for_each_visual_line method is on the last visual line. The
callback now does not return IterationDecision:Continue if
for_each_visual_line method is on the last line and the correct column
is then calculated with the line passed.
|
|
This work is already done (and more correctly) by the parent class
(AbstractView) if we just let it take care of the event instead.
Fixes the root cause of #4096.
|
|
This moves file extension to icon mappings from compile time macros to an
INI config file (/etc/FileIconProvider.ini), so file icons can easily be
customized and extended :^)
I also switched the format from a static file extension (".foo") to
glob-like patterns ("*.foo", using StringUtils::matches()), which allows
us to assign icons to specific exactly matching file names, like many
IDEs do - e.g. "CMakeLists.txt" or ".prettierrc".
|
|
By using Gfx::Bitmap::is_path_a_supported_image_format() we can
automatically provide the image icon for all supported image formats,
without keeping a second list of image file extensions.
|
|
This adds the following:
- cplusplus: .cxx, .cc, .c++
- header: .hpp, .hxx, .hh, .h++
- javascript: .mjs
|
|
Bitmap::is_path_a_supported_image_format() and Bitmap::load_from_file()
now check the file extension with CaseSensitivity::CaseInsensitive.
This fixes a couple of inconsistencies, for example would
FileSystemModel::icon_for() recognize image files uppercase extensions
but couldn't create thumbnails for them (any attempt to create a bitmap
from such files would fail).
|
|
When calculating the vertical distance between icons, we should take
into account the value of the vertical scrollbar.
Fixes #4040
|
|
This is making me question the usefulness of application-global
shortcuts, but for now let's just prevent them from triggering while
you're looking at a modal message box..
|
|
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.
Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.
In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
|
|
Set the max height of the text_rect to be the height difference
between two icons. Calculate the number of text lines that can be
displayed in this height, and display only that many.
|
|
|
|
|
|
...instead of maybe bitmap + a single mime type and its corresponding data.
This allows drag&drop operations to hold multiple different kinds of
data, and the views/applications to choose between those.
For instance, Spreadsheet can keep the structure of the dragged cells,
and still provide text-only data to be passed to different unrelated editors.
|
|
The current implementation is lying, it returns negative values if the
inner rect has a zero width or height but also a scrollbar - which
doesn't mean there's a "negative size" available though; it's still "no
size available", i.e. 0.
|
|
Add a clip rect for the rubber band painter of widget_inner_rect
This ensures the rubber band is not drawn over the scrollbars.
Fixes #3926
|