summaryrefslogtreecommitdiff
path: root/LibGUI/GWidget.h
AgeCommit message (Collapse)Author
2019-05-25LibGUI: Notify widgets when their enabled state changes.Andreas Kling
This is done by dispatching a (synchronous) "EnabledChange" event that can be picked up in change_event(). Use this event to kick widgets out of their "being pressed"-type modes if the user is interacting with them while the state is programmatically changed.
2019-05-24LibGUI: Add a GRadioButton widget.Andreas Kling
Radio buttons are automagically exclusive with other radio button children of the same parent. :^)
2019-05-15Move double click events from LibGUI to the window serverRobin Burchell
2019-05-15LibGUI: Support cycling through focusable widgets with Tab and Shift-Tab.Andreas Kling
2019-05-13WindowServer+LibGUI: Handle mouse wheel deltas in the mouse event stream.Andreas Kling
The wheel events will end up in GWidget::mousewheel_event(GMouseEvent&) on the client-side. This patch also implements basic wheel scrolling in GScrollableWidget via this mechanism. :^)
2019-05-02GWidget: Add set_updates_enabled() for temporarily suppressing updates.Andreas Kling
2019-04-26LibGUI: Track double-clicking per individual mouse button.Andreas Kling
Clicking two separate buttons in quick succession shouldn't be interpreted as a double click.
2019-04-20LibGUI: Allow GActions to be scoped either globally or widget-locally.Andreas Kling
This makes it possible for e.g GTextEditor to create a bunch of actions with popular shortcuts like Ctrl+C, etc, without polluting the global shortcut namespace. Widget-local actions will only activate while their corresponding widget has focus. :^)
2019-04-18LibCore+LibGUI: Make CObject child events synchronous.Andreas Kling
...and then make GWidget layout invalidation lazy. This way we coalesce multiple invalidations into a single relayout and we don't have to worry about child widgets not being fully constructed.
2019-04-18LibGUI: Refactor context menus to be event-driven instead of declarative.Andreas Kling
The declarative approach had way too many limitations. This patch adds a context menu event that can be hooked to prepare a custom context menu on demand just-in-time. :^)
2019-04-16GWidget: Add move_by() and make set_relative_rect() invalidate parent.Andreas Kling
2019-04-16GWidget: Tidy up the hit-testing code somewhat.Andreas Kling
2019-04-16GWidget: Add some new child z-ordering facilities.Andreas Kling
- child_at(Point) - move_to_front() - move_to_back() - is_frontmost() - is_backmost() This patch also makes it possible to receive the mouse event that triggers a context menu before the context menu is shown. I'm not sure this is the best design for context menus but it works for now.
2019-04-14GWidget: Add direct setters for x, y, width & height.Andreas Kling
2019-04-12LibGUI+WindowServer: Add support for per-GWidget context menus.Andreas Kling
You can now simply assign a GMenu as a GWidget's context menu and it will automagically pop up on right click. :^)
2019-04-12GWidget: Add "enabled" state for widgets.Andreas Kling
There's nothing magical that happens for painting, each widget needs to handle it manually in their painting code.
2019-04-11VisualBuilder: Use real GWidgets instead of pretend VBWidgets.Andreas Kling
That first design was the wrong idea. Instead, have VBWidget instantiate a GWidget of the appropriate type and parent it to the VBForm. We then use a new "greedy hit-testing" mechanism in GWidget to prevent any mouse events from reaching the VBForm's children. To paint the grabbers above the child widgets, I added a slightly hackish but kind of neat second_paint_event() that is called after a widget has painted all of his children. :^)
2019-04-10LibCore: Move LibGUI/GObject to LibCore/CObject.Andreas Kling
2019-04-10LibCore: Add CEvent and make LibGUI/GEvent inherit from it.Andreas Kling
2019-04-10Introduce LibCore and move GElapsedTimer => CElapsedTimer.Andreas Kling
I need a layer somewhere between AK (usable both by userspace and kernel) and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-08LibGUI+WindowServer: Add support for GWidget tooltips.Andreas Kling
Any GWidget can have a tooltip and it will automatically pop up below the center of the widget when hovered. GActions added to GToolBars will use the action text() as their tooltip automagically. :^)
2019-04-01LibGUI: Fix broken doubleclick detection due to uninitialized GElapsedTimer.Andreas Kling
2019-03-30LibGUI: Add a simple GSplitter container widget.Andreas Kling
This allows you to put multiple widgets in a container and makes the space in between them draggable to resize the two adjacent widgets.
2019-03-29LibGUI: Don't draw left and right side of surfaces that span entire window.Andreas Kling
In other words, if a surface stretches from the left side of the window all the way to the right side, skip shading and highlighting the sides. This makes widgets blend together just slightly with the window. :^)
2019-03-25LibGUI: Add GWidget::doubleclick_event().Andreas Kling
Now double-clicking an item in a GTableView or GItemView will activate it.
2019-03-19LibGUI: More work on GInputBox.Andreas Kling
- If the GInputBox has a parent and the parent is a GWindow, center the input box window within the parent window. This looks quite nice. - Stop processing events in a nested event loop immediately after it's been asked to quit. - Fix GWidget::parent_widget() behavior for non-widget parents.
2019-03-15IRCClient: Add a toolbar with some actions.Andreas Kling
2019-03-15LibGUI: Add a GStackWidget for many widgets sharing a single location.Andreas Kling
Call set_active_widget(GWidget*) to put a new widget on top.
2019-03-10LibGUI: Don't fill widgets with background color by defualt.Andreas Kling
2019-03-06More work on the variable-width font support.Andreas Kling
Katica is now the default system font, and it looks quite nice. :^) I'm gonna need to refine the GTextBox movement stuff eventually, but it works well-enough for basic editing now.
2019-02-20LibGUI: Implement enter/leave events (with WindowServer support.)Andreas Kling
Windows now learn when the mouse cursor leaves or enters them. Use this to implement GWidget::{enter,leave}_event() and use that to implement the CoolBar button effect. :^)
2019-02-19WindowServer: Support windows with alpha channels. And per-WSWindow opacity.Andreas Kling
This patch also adds a Format concept to GraphicsBitmap. For now there are only two formats: RGB32 and RGBA32. Windows with alpha channel have their backing stores created in the RGBA32 format. Use this to make Terminal windows semi-transparent for that comfy rice look. There is one problem here, in that window compositing overdraw incurs multiple passes of blending of the same pixels. This leads to a mismatch in opacity which is obviously not good. I will work on this in a later patch. The alpha blending is currently straight C++. It should be relatively easy to optimize this using SSE instructions. For now I'm just happy with the cute effect. :^)
2019-02-10LibGUI: Coalesce update rects at the GWindow level.Andreas Kling
2019-02-10Port Terminal to LibGUI.Andreas Kling
To facilitate listening for action on arbitrary file descriptors, I've added a GNotifier class. It's quite simple but very useful: GNotifier notifier(fd, GNotifier::Read); notifier.on_ready_to_read = [this] (GNotifier& fd) { // read from fd or whatever else you like :^) }; The callback will get invoked by GEventLoop when select() says we have something to read on the fd.
2019-02-10LibGUI: Start adding an automatic widget layout system.Andreas Kling
My needs are really quite simple, so I'm just going to add what I need as I go along. The first thing I needed was a simple box layout with widgets being able to say whether they prefer fixed or fill for both their vertical and horizontal sizes. I also made a simple GStatusBar so FileManager can show how many bytes worth of files are in the current directory.
2019-02-09LibGUI: Widget updates should invalidate their window-relative rect.Andreas Kling
2019-02-09LibGUI: Start working on a GScrollBar.Andreas Kling
This widget is far from finished, but it's off to a good start. Also added a GResizeEvent and GWidget::resize_event() so that widgets can react to being resized.
2019-02-08Launcher: Factor the app buttons into a LaunchButton class.Andreas Kling
Added some LibGUI helpers while I'm at it.
2019-02-02Start working on a simple graphical font editor.Andreas Kling
Editing fonts by editing text files is really slow and boring. A simple font editor seems like a good way to take LibGUI for a spin.
2019-01-27Make buttons unpress when the cursor leaves the button rect.Andreas Kling
Implement this functionality by adding global cursor tracking. It's currently only possible for one GWidget per GWindow to track the cursor.
2019-01-26LibGUI: Flesh out focus implementation and more GTextBox work.Andreas Kling
2019-01-24Let userland retain the window backing store while drawing into it.Andreas Kling
To start painting, call: gui$get_window_backing_store() Then finish up with: gui$release_window_backing_store() Process will retain the underlying GraphicsBitmap behind the scenes. This fixes racing between the WindowServer and GUI clients. This patch also adds a WSWindowLocker that is exactly what it sounds like.
2019-01-21LibGUI: Mass coding style fixes.Andreas Kling
2019-01-20LibGUI: Hook up GWindow event dispatch for paint and mouse events.Andreas Kling
2019-01-20Rename all the LibGUI classes to GClassName.Andreas Kling