From 3ee32b6dbffc00eb8fa3385b2cac9322509f0746 Mon Sep 17 00:00:00 2001 From: Dylan Katz Date: Fri, 28 Jan 2022 23:29:10 -0800 Subject: [PATCH] MouseSettings: Set icons from GML --- Userland/Applications/MouseSettings/Mouse.gml | 6 +++--- Userland/Applications/MouseSettings/MouseWidget.cpp | 8 -------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Userland/Applications/MouseSettings/Mouse.gml b/Userland/Applications/MouseSettings/Mouse.gml index 09477bc223..fc445c1e3e 100644 --- a/Userland/Applications/MouseSettings/Mouse.gml +++ b/Userland/Applications/MouseSettings/Mouse.gml @@ -23,7 +23,7 @@ @GUI::Label { fixed_width: 32 fixed_height: 32 - name: "cursor_speed_image_label" + icon: "/res/graphics/mouse-cursor-speed.png" } @GUI::Label { @@ -72,7 +72,7 @@ @GUI::Label { fixed_width: 32 fixed_height: 32 - name: "scroll_step_size_image_label" + icon: "/res/graphics/scroll-wheel-step-size.png" } @GUI::Label { @@ -176,7 +176,7 @@ @GUI::Label { fixed_width: 32 fixed_height: 32 - name: "switch_buttons_image_label" + icon: "/res/graphics/switch-mouse-buttons.png" } @GUI::CheckBox { diff --git a/Userland/Applications/MouseSettings/MouseWidget.cpp b/Userland/Applications/MouseSettings/MouseWidget.cpp index 865a4cf3d4..31fd759f8b 100644 --- a/Userland/Applications/MouseSettings/MouseWidget.cpp +++ b/Userland/Applications/MouseSettings/MouseWidget.cpp @@ -31,12 +31,6 @@ MouseWidget::MouseWidget() int const slider_value = float { speed_slider_scale } * GUI::WindowServerConnection::the().get_mouse_acceleration(); m_speed_slider->set_value(slider_value); - auto& cursor_speed_image_label = *find_descendant_of_type_named("cursor_speed_image_label"); - cursor_speed_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/graphics/mouse-cursor-speed.png").release_value_but_fixme_should_propagate_errors()); - - auto& scroll_step_size_image_label = *find_descendant_of_type_named("scroll_step_size_image_label"); - scroll_step_size_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/graphics/scroll-wheel-step-size.png").release_value_but_fixme_should_propagate_errors()); - m_scroll_length_spinbox = *find_descendant_of_type_named("scroll_length_spinbox"); m_scroll_length_spinbox->set_min(WindowServer::scroll_step_size_min); m_scroll_length_spinbox->set_value(GUI::WindowServerConnection::the().get_scroll_step_size()); @@ -53,8 +47,6 @@ MouseWidget::MouseWidget() m_double_click_speed_slider->set_value(GUI::WindowServerConnection::the().get_double_click_speed()); m_switch_buttons_checkbox = *find_descendant_of_type_named("switch_buttons_input"); m_switch_buttons_checkbox->set_checked(GUI::WindowServerConnection::the().get_buttons_switched()); - auto& switch_buttons_image_label = *find_descendant_of_type_named("switch_buttons_image_label"); - switch_buttons_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/graphics/switch-mouse-buttons.png").release_value_but_fixme_should_propagate_errors()); } void MouseWidget::apply_settings()