mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibGUI: Use ControlBoxButtons in SpinBox and ComboBox
Converts the buttons of these widgets into ControlBoxButtons.
This commit is contained in:
parent
bf59cd7ca5
commit
c90fe7ce93
Notes:
sideshowbarker
2024-07-19 04:42:22 +09:00
Author: https://github.com/thankyouverycool
Commit: c90fe7ce93
Pull-request: https://github.com/SerenityOS/serenity/pull/2839
4 changed files with 12 additions and 11 deletions
|
@ -24,7 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/ControlBoxButton.h>
|
||||
#include <LibGUI/SpinBox.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
|
||||
|
@ -41,14 +41,13 @@ SpinBox::SpinBox()
|
|||
else
|
||||
m_editor->set_text(String::number(m_value));
|
||||
};
|
||||
m_increment_button = add<Button>();
|
||||
|
||||
m_increment_button = add<ControlBoxButton>(ControlBoxButton::UpArrow);
|
||||
m_increment_button->set_focusable(false);
|
||||
m_increment_button->set_text("\xE2\xAC\x86"); // UPWARDS BLACK ARROW
|
||||
m_increment_button->on_click = [this](auto) { set_value(m_value + 1); };
|
||||
m_increment_button->set_auto_repeat_interval(150);
|
||||
m_decrement_button = add<Button>();
|
||||
m_decrement_button = add<ControlBoxButton>(ControlBoxButton::DownArrow);
|
||||
m_decrement_button->set_focusable(false);
|
||||
m_decrement_button->set_text("\xE2\xAC\x87"); // DOWNWARDS BLACK ARROW
|
||||
m_decrement_button->on_click = [this](auto) { set_value(m_value - 1); };
|
||||
m_decrement_button->set_auto_repeat_interval(150);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue