summaryrefslogtreecommitdiff
path: root/LibGUI/GButton.cpp
AgeCommit message (Collapse)Author
2019-07-04Libraries: Create top level directory for libraries.Andreas Kling
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
2019-06-21AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.Andreas Kling
2019-06-21LibGUI: Refactor the keyboard activation code a bit to use WeakPtr<GWidget>.Andreas Kling
2019-06-16LibGUI: clang-formatfaissaloo
2019-06-15Merge remote-tracking branch 'origin/master' into serenity-keysfaissaloo
2019-06-12LibGUI: Add an "exclusive" property to GAbstractButtons.Andreas Kling
This makes checkable buttons exclusive with other checkable buttons in the same parent widget. Basically like radio buttons. This should probably be used to implement GRadioButton once it's a bit more mature.
2019-06-07LibGUI: Run clang-format on everything.Andreas Kling
2019-06-03StringViewize a bunch of things -- mostly LibGUIRobin Burchell
2019-06-03GWindow: Leave SerenityKey mode if non-existent keybind is usedfaissaloo
2019-06-03GWindow: Add SerenityKeys minimum functionalityfaissaloo
2019-05-25GButton: Align the button text according to text_alignment().Andreas Kling
Added a Rect::align_within(other_rect, alignment) helper that seemed useful.
2019-05-25LibGUI: Elide the text in GCheckBox and GRadioButton when low on space.Andreas Kling
2019-05-24LibGUI: Share code for text painting in GAbstractButton.Andreas Kling
This gives all the GAbstractButton a consistent disabled appearance.
2019-05-24Demos: Start working on a simple WidgetGallery app.Andreas Kling
It's good to have a place where we can try out all the different widgets. This needs some more work on a nice layout, and should also include more of the widgets. :^)
2019-05-24LibGUI: Add a GAbstractButton base class for button widgets.Andreas Kling
This patch moves GButton and GRadioButton to inherit from it. This allows them to share code for mouse event handling, etc.
2019-05-16GButton: Only draw focus rect if there is a caption text.Andreas Kling
2019-05-15GButton: Allow triggering a "click" by pressing Return when focused.Andreas Kling
2019-05-15LibGUI: Support cycling through focusable widgets with Tab and Shift-Tab.Andreas Kling
2019-05-02GButton: Draw disabled buttons with grayed-out text.Andreas Kling
Based on a patch from "pd" (thanks!)
2019-05-01GButton: Update hovered state on mouseover as well.Andreas Kling
We can't rely exclusively on enter and leave events to update the hovered state, since leave will not be delivered while the widget is auto-tracking the mouse (between mousedown and mouseup.)
2019-05-01GButton: Handle mousemove correctly while multiple buttons are pressed.Andreas Kling
We should still update the pressed state depending on the event position, even if GMouseButton::Left is not the only button pressed.
2019-04-26LibGUI+WindowServer: Make it possible to have checkable GActions.Andreas Kling
They show up as checkable GButtons in GToolBar, and with (or without) check marks in menus. There are a bunch of places to make use of this. This patch only takes advantage of it in the FileManager for the view type actions.
2019-04-14AK: Improve smart pointer ergonomics a bit.Andreas Kling
2019-04-13WindowServer+LibGUI: Add ability to set per-window icons.Andreas Kling
The icons are passed around as filesystem paths for now, since the shared memory bitmaps only support 2 sides.
2019-04-12LibGUI+WindowServer: Add support for enabled/disabled actions.Andreas Kling
The enabled state of a GAction now propagates both to any toolbar buttons and any menu items linked to the action. Toolbar buttons are painted in a grayed out style when disabled. Menu items are gray when disabled. :^)
2019-04-10LibCore: Add CEvent and make LibGUI/GEvent inherit from it.Andreas Kling
2019-04-06LibGUI: GButton's caption should be drawn in the foreground color.Andreas Kling
2019-04-04LibGUI: Use TextElision::Right for GButton captions.Andreas Kling
2019-04-04LibGUI: Allow specifying GButton text alignment.Andreas Kling
2019-04-04LibGUI: Make it possible for GButton to be checkable.Andreas Kling
2019-04-03AK: Add Eternal<T> and use it in various places.Andreas Kling
This is useful for static locals that never need to be destroyed: Thing& Thing::the() { static Eternal<Thing> the; return the; } The object will be allocated in data segment memory and will never have its destructor invoked.
2019-03-29Rename Painter::set_clip_rect() to add_clip_rect().Andreas Kling
It was confusing to see multiple calls to set_foo() in a row. Since this is an intersecting operation, let's call it add_clip_rect() instead.
2019-03-28Move LibGUI/GStyle to SharedGraphics/StylePainter.Andreas Kling
I want to paint some buttons in WindowServer where we don't have LibGUI.
2019-03-28LibGUI: Add a GPainter class that inherits from Painter.Andreas Kling
This gets rid of the last little piece of LibGUI knowledge in Painter.
2019-03-24WindowServer+LibGUI: Implement automatic cursor tracking.Andreas Kling
When a mouse button is pressed inside a window, put that window into an automatic mouse tracking state where all mouse events are sent to that window until all mouse buttons are released. This might feel even better if it only cared about the mouse buttons you actually pressed while *inside* the windows to get released, I don't know. I'll have to use it for a while and see how it's like.
2019-03-19LibGUI: Add GInputBox for getting a string from a modal dialog.Andreas Kling
Use this to implement some of the toolbar actions in IRCClient. :^)
2019-03-19LibGUI: Implement nested event loops to support dialog boxes.Andreas Kling
This patch adds a simple GMessageBox that can run in a nested event loop. Here's how you use it: GMessageBox box("Message text here", "Message window title"); int result = box.exec(); The next step is to make the WindowServer respect the modality flag of these windows and prevent interaction with other windows in the same process until the modal window has been closed.
2019-03-10LibGUI: Don't fill widgets with background color by defualt.Andreas Kling
2019-02-28LibGUI: Clip to paint event rect in most widgets.Andreas Kling
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-20LibGUI: Support different button styles.Andreas Kling
I want to try an MS Office 97 "CoolBar" inspired look for my toolbars. This is only the painting support, we still need hover events to implement the actual 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-11WindowServer: More work on menus.Andreas Kling
2019-02-10LibGUI: Share code for widget rendering styles in a GStyle class.Andreas Kling
Since GScrollBar wants its internal buttons to look like GButtons, let's share the painting code between them.
2019-02-07Start working on a simple Launcher app.Andreas Kling
Let GButton have an optional icon (GraphicsBitmap) that gets rendered in the middle of the button if present. Also add GraphicsBitmap::load_from_file() which allows mmap'ed RGBA32 files. I wrote a little program to take "raw" files from GIMP and swizzle them into the correct byte order.
2019-02-05SharedGraphics: Add some useful painting helpers and make use of them.Andreas Kling
2019-02-05Rename LizaBold to LizaRegular and LizaBlack to LizaBold.Andreas Kling
LizaRegular is quickly becoming my favorite bitmap font. It's so pretty :^)
2019-02-04LibGUI: Use LizaBold as the default button font.Andreas Kling
2019-01-27LibGUI: GButton should only react to the left mouse button (for pushing.)Andreas Kling
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.