Commit Graph

277 Commits

Author SHA1 Message Date
Andreas Kling
108b663618 GScrollBar: Clicking in the gutter should jump directly to that position.
I think I like how this feels but I'm not 100% sure yet, so I'm leaving
the old feel in behind an #ifdef.
2019-03-25 05:03:40 +01:00
Andreas Kling
614dafea32 FileManager+LibGUI: Show thumbnail generation progress in the statusbar. 2019-03-25 04:25:25 +01:00
Andreas Kling
32191b0d4b GBoxLayout: Don't subtract margins from the available space twice. 2019-03-25 04:24:20 +01:00
Andreas Kling
20f7d7ec67 LibGUI: Add GWidget::doubleclick_event().
Now double-clicking an item in a GTableView or GItemView will activate it.
2019-03-25 01:43:32 +01:00
Andreas Kling
b4da451c9a WindowServer+LibGUI: Implement automatic cursor tracking.
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-24 15:01:56 +01:00
Andreas Kling
86413a6f5a LibGUI+FileManager: Add a GIcon class to support multi-size icons.
A GIcon can contain any number of bitmaps internally, and will give you
the best fitting icon when you call bitmap_for_size().
2019-03-24 04:28:36 +01:00
Andreas Kling
1355d09c72 GItemView: Implement up/down/left/right keyboard navigation. 2019-03-23 04:05:58 +01:00
Andreas Kling
19fa70c821 LibGUI: Add a GItemView class.
This is a GAbstractView subclass that implements a icon-based view onto
a GModel. It still need a bunch of work, but it's in basic usable shape.
2019-03-23 03:54:45 +01:00
Andreas Kling
5707d7f547 LibGUI: Add GAbstractView base class for GTableView.
This is in preparation for adding a new view class.
2019-03-23 02:04:31 +01:00
Andreas Kling
994cf10b3e LibGUI: Rename GTableModel => GModel. 2019-03-23 01:42:49 +01:00
Andreas Kling
d563dc0565 LibGUI: Add a setting to make GLabel stretch its icon.
Use this in QuickShow to allow arbitrarily scaling the opened image.
2019-03-22 04:20:48 +01:00
Andreas Kling
e4498194c2 LibGUI: Remove unnecessary timer in GProgressBar. 2019-03-22 02:49:57 +01:00
Andreas Kling
c3b0c1ba68 LibGUI: Add a GProgressBar widget. 2019-03-22 02:49:45 +01:00
Andreas Kling
e4dfd5a3a4 WindowServer: Support PNG wallpapers.
Fix up /bin/pape so it tells the WindowServer which wallpaper file to use.
2019-03-21 15:54:19 +01:00
Andreas Kling
42755e98cf SharedGraphics: Implement a simple PNG decoder.
This is extremely unoptimized, but it does successfully load "folder32.png"
so it must be at least somewhat correct. :^)
2019-03-21 03:57:42 +01:00
Andreas Kling
ed2303e2d8 TextEditor: The delete key should work even when there's no selection. 2019-03-20 23:11:00 +01:00
Andreas Kling
be4533717a FileManager: Add ability to create new directories. 2019-03-20 22:40:06 +01:00
Andreas Kling
1030e6b848 FileManager: Add a "Location:" label. 2019-03-20 22:01:02 +01:00
Andreas Kling
f0915641c5 TextEditor: Add "delete" action. 2019-03-20 18:16:04 +01:00
Andreas Kling
daa1dcb5e8 FileManager: Use a GTextEditor for the location bar + tweak icons. 2019-03-20 18:12:56 +01:00
Andreas Kling
951377e93e GTableView: Add ability to hide individual columns at view-level.
Use this in IRCClient to hide the "sender" column in the server message view
since everything in that view comes from the "Server" anyway.
2019-03-20 13:36:07 +01:00
Andreas Kling
d17a91f185 Move WindowServer into Servers. 2019-03-20 04:34:14 +01:00
Andreas Kling
f47945759b LibGUI: Make GTableModel a retainable object.
It became clear that this class needs to support multiple owners.
2019-03-20 03:27:07 +01:00
Andreas Kling
3ecfde193a GEventLoop: Quit the event loop on EOF from the WindowServer. 2019-03-20 01:10:52 +01:00
Andreas Kling
9551e2e4b5 LibGUI: Add GScrollableWidget::scroll_to_bottom/top(). 2019-03-19 03:09:21 +01:00
Andreas Kling
e15cc4509f LibGUI: More GInputBox refinements.
Fix some GBoxLayout bugs to make the buttons in GInputBox line up better.
There are still some imperfections due to rounding errors.
2019-03-19 03:00:42 +01:00
Andreas Kling
46577a6948 GTextEditor: Fix invalidation glitches in single-line mode. 2019-03-19 02:45:49 +01:00
Andreas Kling
f88e550998 LibGUI: More work on GInputBox.
- 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-19 02:22:49 +01:00
Andreas Kling
a6538feed1 LibGUI: Add GInputBox for getting a string from a modal dialog.
Use this to implement some of the toolbar actions in IRCClient. :^)
2019-03-19 01:41:00 +01:00
Andreas Kling
43304d2adf WindowServer: Add special treatment for modal windows.
While a WSClientConnection has a modal window showing, non-modal windows
belonging to that client are not sent any events.
2019-03-19 00:52:39 +01:00
Andreas Kling
57ff293a51 LibGUI: Implement nested event loops to support dialog boxes.
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-19 00:01:02 +01:00
Andreas Kling
a319641fc4 GIODevice: Remove debug spam. 2019-03-18 15:36:16 +01:00
Andreas Kling
9ad076178a GIODevice: Add a read_all() that returns a ByteBuffer with all we can read.
Use this to implement file opening in TextEditor.
2019-03-18 14:38:30 +01:00
Andreas Kling
8e3d0a23d5 LibGUI: Add GTCPSocket and base class GSocket (inherits from GIODevice.)
And use these to do the line-by-line reading automagically instead of having
that logic in IRCClient. This will definitely come in handy.
2019-03-18 14:09:58 +01:00
Andreas Kling
d466f2634d LibGUI: Add GTableModel::Role::ForegroundColor.
This makes it possible to specify the text color for each table cell.
Use this to make the IRCClient show unread window list items in red.
2019-03-18 04:54:07 +01:00
Andreas Kling
77a782a67e LibGUI: Don't crash if calling GClipboard::set_data() with a null string. 2019-03-18 02:59:08 +01:00
Andreas Kling
ce7017e1ec LibGUI: Add GFile and base class GIODevice.
Working with the LibC API's is tedious, so let's add some comfy C++ API's.
2019-03-17 15:54:43 +01:00
Andreas Kling
4e451c1e92 Add client-side double buffering of window backing stores.
This prevents flicker and looks rather good. The main downside is that
resizing gets even more sluggish. That's the price we pay for now.
2019-03-17 04:23:54 +01:00
Andreas Kling
0f49b5e7be LibGUI: Ignore GWindow::update() with an empty rect. 2019-03-17 01:36:38 +01:00
Andreas Kling
01a2035ecf LibGUI: Don't nap in event loop if there are already queued events.
This mirrors the WindowServer fix.
2019-03-17 01:34:31 +01:00
Andreas Kling
ec8bffb06d LibGUI: Let GTextEditor deal with its horizontal padding internally.
I originally wanted to have the padding concept in GScrollableWidget
but it's really finicky with the ruler and everything.
2019-03-16 23:16:37 +01:00
Andreas Kling
3854e752cb LibGUI: Make GTextEditor inherit from GScrollableWidget.
This is quite nice, now we can share a ton of logic. :^)
2019-03-16 16:54:51 +01:00
Andreas Kling
6fbabac460 LibGUI: Factor out scrolling logic from GTableView into a GScrollableWidget.
This then becomes the base class for GTableView. I'd like to share as much
code as possible with GTextEditor and any other scrollable widgets.
2019-03-16 16:03:31 +01:00
Andreas Kling
eb610b309e LibGUI: Make class_name() public so you can always call it.
I found myself having to cast to GWidget* all the time when writing some
generic debugging code that just wanted to dump widget info.
2019-03-16 12:57:04 +01:00
Andreas Kling
5c2d405e1f IRCClient: Add menus. 2019-03-16 01:10:48 +01:00
Andreas Kling
3a3aa74b2e IRCClient: Add a toolbar with some actions. 2019-03-15 23:24:40 +01:00
Andreas Kling
b54ab06595 GTableView: Add a way to turn off alternating row colors. 2019-03-15 21:41:27 +01:00
Andreas Kling
7e3673f710 GTextEditor: Disable the ruler in single-line mode.
Also make it possible to hide the ruler in multi-line mode, if you should
want to do that. :^)
2019-03-15 17:54:05 +01:00
Andreas Kling
1fc283ed7d IRCClient+LibGUI: Add an input box so we can send messages to channels.
Implement this using a GTextEditor with a special single-line mode.
This new mode needs some polishing, but it's already very useful.
2019-03-15 17:37:13 +01:00
Andreas Kling
ad08165a25 LibGUI: Hit testing should skip invisible widgets. 2019-03-15 16:45:27 +01:00