Tibor Nagy
18c67b4002
LibGUI: Fix 1px misalignment of ColorButton selections in ColorPicker
...
Also use shrunken() to calculate the selection rects.
2020-10-02 13:08:32 +02:00
Tibor Nagy
8b293119ab
LibGUI: Update color widgets when has_alpha is toggled in ColorPicker
...
Fixing a bug where the alpha spinbox wasn't immediately disabled when
color_has_alpha_channel was set to false.
2020-09-26 19:55:54 +02:00
Tibor Nagy
5b7decc3af
LibGUI: Add alpha preview to ColorPicker
2020-09-26 00:00:08 +02:00
Ben Wiederhake
ede5dbd7b3
Meta+LibC through LibHTTP: Make clang-format-10 clean
...
Why break at LibHTTP? Because "Meta+Libraries" would be insanely large,
and breaking between LibHTTP and LibJS makes the commits roughly evenly large.
2020-09-25 21:18:17 +02:00
Peter Elliott
1720030625
LibGUI: Don't recalcuate color from hue if it was not set by hue
...
Basically, setting the hue is numerically sensitive when the value or
saturation are low.
2020-09-17 09:47:05 +02:00
Peter Elliott
9670d9ad50
LibGUI: Don't allow 4 character html color codes in GUI::ColorPicker
...
When 4 character colors were allowed, backspace misbehaved and you
couldn't backspace the whole color.
2020-09-17 09:47:05 +02:00
LepkoQQ
777b298880
LibGUI: Change window size and margin in ColorPicker
2020-08-26 00:38:23 +02:00
LepkoQQ
9e75c124a8
LibGUI: Add spinbox for alpha channel in ColorPicker
2020-08-26 00:38:23 +02:00
LepkoQQ
b10dde70b7
LibGUI: Show current and selected color comparison in ColorPicker
2020-08-26 00:38:23 +02:00
LepkoQQ
9f5310d607
LibGUI: Resize ColorPicker to include frame thickness
...
Also clamp mouse events to frame rect when dragging outside of the color
field area.
Store hue separately from color, to prevent pure white resetting the hue
back to 0.
2020-08-26 00:38:23 +02:00
LepkoQQ
189c493162
LibGUI: Split ColorPicker in to a field and slider
2020-08-26 00:38:23 +02:00
LepkoQQ
0604f82a96
LibGUI: Select current color when opening picker
2020-08-26 00:38:23 +02:00
Linus Groh
675d8eec60
LibGUI: Fix ColorPicker custom color offset
...
Previously the ColorPicker would get the custom color directly from the
window, this was changed in d7d5788469
to
get the color from the underlying bitmap instead - without taking the
bitmap's scaling into effect though, so resulting colors were off by
quite a bit.
Fixes #3113 .
2020-08-13 16:58:31 +02:00
Andreas Kling
116cf92156
LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
...
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Andreas Kling
977863ea07
LibGUI: Include keyboard modifier state with button on_click calls
...
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
77916f030f
LibGUI: Use "OK, Cancel" button order in ColorPicker
2020-04-29 19:29:09 +02:00
Andreas Kling
51ab0e967e
LibGUI: Use a sunken GUI::Frame for the ColorPicker color spectrum
...
This looks a lot nicer than just a plain widget. :^)
2020-04-29 19:28:19 +02:00
Andreas Kling
d7d5788469
LibGUI: ColorPicker should pick custom color from bitmap, not window
...
It's not always safe to access pixel data of a window's backing store
since the kernel may decide to purge it at his leisure. Fix this by
instead picking colors from the color spectrum bitmap directly instead.
Also fix up mouse event logic while we're here so it only cares about
the left mouse button
Fixes #1657 .
2020-04-29 19:17:40 +02:00
Andreas Kling
6a01827046
LibGUI: Exit ColorPicker (successfully) when double-clicking a color
...
It feels natural that if I double click a color button, the dialog
closes successfully and "returns" that color.
2020-04-29 19:17:40 +02:00
Andreas Kling
f8069418e1
LibGUI: Transfer "color has alpha channel" state
2020-04-29 16:22:09 +02:00
Andreas Kling
2463a285ee
LibGUI: Make GUI::TabWidget::add_tab<T>() return a T&
...
Since the newly constructed sub-widget is owned by the TabWidget,
we can simply return a T& here. :^)
2020-04-04 11:10:07 +02:00
Andreas Kling
9430918026
LibGUI: Move ColorPicker's helper classes fully into ColorPicker.cpp
...
Since these are not used by the outside world, no need to expose them.
2020-04-04 10:38:39 +02:00
Hüseyin ASLITÜRK
177b30629c
LibGUI: Add color palette and custom color selection in the ColorPicker
2020-04-04 10:32:44 +02:00
Andreas Kling
b29ff7b821
LibGUI: Don't use Core::Object::add() to instantiate dialogs
...
Now that add() returns a WidgetType&, we can't rely on the parent of a
GUI::Dialog to still keep it alive after exec() returns. This happens
because exec() will call remove_from_parent() on itself before
returning.
And so we go back to the old idiom for creating a GUI::Dialog centered
above a specific window. Just call GUI::Dialog::construct(), passing
the "parent" window as the last parameter.
2020-03-04 21:04:06 +01:00
Andreas Kling
028c011760
LibCore: Make Core::Object::add<ChildType> return a ChildType&
...
Since the returned object is now owned by the callee object, we can
simply vend a ChildType&. This allows us to use "." instead of "->"
at the call site, which is quite nice. :^)
2020-03-04 21:04:06 +01:00
Andreas Kling
0f3e57a6fb
LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients
2020-03-04 14:26:16 +01:00
Andreas Kling
4697195645
LibGUI: Use set_layout<LayoutType>() in lots of client code
2020-03-04 13:49:48 +01:00
Andreas Kling
a26b63a958
LibGUI: Remove Button& parameter from Button::on_click hook
...
There was but a single user of this parameter and it's a bit tedious
to write it out every time, so let's get rid of it.
2020-03-03 17:02:38 +01:00
Andreas Kling
45c25ffecd
LibGUI: Use Core::Object::add() a whole bunch
2020-02-23 11:10:52 +01:00
Andreas Kling
34c7322d77
LibGUI: Remove some header dependencies from Widget.h
2020-02-14 23:53:11 +01:00
Andreas Kling
6a9cc66b97
LibGUI: Remove leading G from filenames
2020-02-06 20:33:02 +01:00