mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:07:35 +00:00
DisplaySettings: Propagate errors in DesktopSettingsWidget
This commit is contained in:
parent
9c7dfd4fd4
commit
c95ec6092b
2 changed files with 13 additions and 9 deletions
|
@ -15,15 +15,16 @@
|
|||
|
||||
namespace DisplaySettings {
|
||||
|
||||
DesktopSettingsWidget::DesktopSettingsWidget()
|
||||
{
|
||||
create_frame();
|
||||
load_current_settings();
|
||||
ErrorOr<NonnullRefPtr<DesktopSettingsWidget>> DesktopSettingsWidget::try_create() {
|
||||
auto desktop_settings_widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) DesktopSettingsWidget()));
|
||||
TRY(desktop_settings_widget->create_frame());
|
||||
desktop_settings_widget->load_current_settings();
|
||||
return desktop_settings_widget;
|
||||
}
|
||||
|
||||
void DesktopSettingsWidget::create_frame()
|
||||
ErrorOr<void> DesktopSettingsWidget::create_frame()
|
||||
{
|
||||
load_from_gml(desktop_settings_gml).release_value_but_fixme_should_propagate_errors();
|
||||
TRY(load_from_gml(desktop_settings_gml));
|
||||
|
||||
m_workspace_rows_spinbox = *find_descendant_of_type_named<GUI::SpinBox>("workspace_rows_spinbox");
|
||||
m_workspace_rows_spinbox->on_change = [&](auto) {
|
||||
|
@ -36,6 +37,8 @@ void DesktopSettingsWidget::create_frame()
|
|||
|
||||
auto& keyboard_shortcuts_label = *find_descendant_of_type_named<GUI::Label>("keyboard_shortcuts_label");
|
||||
keyboard_shortcuts_label.set_text("\xE2\x84\xB9\tCtrl+Alt+{Shift}+Arrows moves between workspaces");
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void DesktopSettingsWidget::load_current_settings()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue