diff options
Diffstat (limited to 'Applications/DisplaySettings')
-rw-r--r-- | Applications/DisplaySettings/DisplaySettings.cpp | 6 | ||||
-rw-r--r-- | Applications/DisplaySettings/DisplaySettings.h | 2 | ||||
-rw-r--r-- | Applications/DisplaySettings/MonitorWidget.cpp | 8 | ||||
-rw-r--r-- | Applications/DisplaySettings/MonitorWidget.h | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Applications/DisplaySettings/DisplaySettings.cpp b/Applications/DisplaySettings/DisplaySettings.cpp index aa38bbc2a8..303b20f8b3 100644 --- a/Applications/DisplaySettings/DisplaySettings.cpp +++ b/Applications/DisplaySettings/DisplaySettings.cpp @@ -198,7 +198,7 @@ void DisplaySettingsWidget::create_frame() m_resolution_combo->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); m_resolution_combo->set_preferred_size(0, 22); m_resolution_combo->set_only_allow_values_from_model(true); - m_resolution_combo->set_model(*ItemListModel<Gfx::Size>::create(m_resolutions)); + m_resolution_combo->set_model(*ItemListModel<Gfx::IntSize>::create(m_resolutions)); m_resolution_combo->on_change = [this](auto&, const GUI::ModelIndex& index) { this->m_monitor_widget->set_desktop_resolution(m_resolutions.at(index.row())); this->m_monitor_widget->update(); @@ -301,7 +301,7 @@ void DisplaySettingsWidget::load_current_settings() } /// Resolution //////////////////////////////////////////////////////////////////////////////// - Gfx::Size find_size; + Gfx::IntSize find_size; bool okay = false; // Let's attempt to find the current resolution and select it! @@ -318,7 +318,7 @@ void DisplaySettingsWidget::load_current_settings() } size_t index = m_resolutions.find_first_index(find_size).value_or(0); - Gfx::Size m_current_resolution = m_resolutions.at(index); + Gfx::IntSize m_current_resolution = m_resolutions.at(index); m_monitor_widget->set_desktop_resolution(m_current_resolution); m_resolution_combo->set_selected_index(index); diff --git a/Applications/DisplaySettings/DisplaySettings.h b/Applications/DisplaySettings/DisplaySettings.h index d0215c7887..d66fa6ff9c 100644 --- a/Applications/DisplaySettings/DisplaySettings.h +++ b/Applications/DisplaySettings/DisplaySettings.h @@ -47,7 +47,7 @@ private: Vector<String> m_wallpapers; Vector<String> m_modes; - Vector<Gfx::Size> m_resolutions; + Vector<Gfx::IntSize> m_resolutions; RefPtr<GUI::Widget> m_root_widget; RefPtr<MonitorWidget> m_monitor_widget; diff --git a/Applications/DisplaySettings/MonitorWidget.cpp b/Applications/DisplaySettings/MonitorWidget.cpp index 1bd44888bc..71d6651593 100644 --- a/Applications/DisplaySettings/MonitorWidget.cpp +++ b/Applications/DisplaySettings/MonitorWidget.cpp @@ -54,12 +54,12 @@ String MonitorWidget::wallpaper_mode() return m_desktop_wallpaper_mode; } -void MonitorWidget::set_desktop_resolution(Gfx::Size resolution) +void MonitorWidget::set_desktop_resolution(Gfx::IntSize resolution) { m_desktop_resolution = resolution; } -Gfx::Size MonitorWidget::desktop_resolution() +Gfx::IntSize MonitorWidget::desktop_resolution() { return m_desktop_resolution; } @@ -76,7 +76,7 @@ Gfx::Color MonitorWidget::background_color() void MonitorWidget::paint_event(GUI::PaintEvent& event) { - Gfx::Rect screen_rect = { 0, 0, m_desktop_resolution.width(), m_desktop_resolution.height() }; + Gfx::IntRect screen_rect = { 0, 0, m_desktop_resolution.width(), m_desktop_resolution.height() }; auto screen_bitmap = Gfx::Bitmap::create(m_monitor_bitmap->format(), m_desktop_resolution); GUI::Painter screen_painter(*screen_bitmap); screen_painter.fill_rect(screen_rect, m_desktop_color); @@ -85,7 +85,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event) if (m_desktop_wallpaper_mode == "simple") { screen_painter.blit({ 0, 0 }, *m_desktop_wallpaper_bitmap, m_desktop_wallpaper_bitmap->rect()); } else if (m_desktop_wallpaper_mode == "center") { - Gfx::Point offset { screen_rect.width() / 2 - m_desktop_wallpaper_bitmap->size().width() / 2, screen_rect.height() / 2 - m_desktop_wallpaper_bitmap->size().height() / 2 }; + Gfx::IntPoint offset { screen_rect.width() / 2 - m_desktop_wallpaper_bitmap->size().width() / 2, screen_rect.height() / 2 - m_desktop_wallpaper_bitmap->size().height() / 2 }; screen_painter.blit_offset(screen_rect.location(), *m_desktop_wallpaper_bitmap, screen_rect, offset); } else if (m_desktop_wallpaper_mode == "tile") { screen_painter.draw_tiled_bitmap(screen_bitmap->rect(), *m_desktop_wallpaper_bitmap); diff --git a/Applications/DisplaySettings/MonitorWidget.h b/Applications/DisplaySettings/MonitorWidget.h index f77fe67eb9..fa0a5dbbf8 100644 --- a/Applications/DisplaySettings/MonitorWidget.h +++ b/Applications/DisplaySettings/MonitorWidget.h @@ -41,8 +41,8 @@ public: void set_wallpaper_mode(String mode); String wallpaper_mode(); - void set_desktop_resolution(Gfx::Size resolution); - Gfx::Size desktop_resolution(); + void set_desktop_resolution(Gfx::IntSize resolution); + Gfx::IntSize desktop_resolution(); void set_background_color(Gfx::Color background_color); Gfx::Color background_color(); @@ -50,12 +50,12 @@ public: private: virtual void paint_event(GUI::PaintEvent& event) override; - Gfx::Rect m_monitor_rect; + Gfx::IntRect m_monitor_rect; RefPtr<Gfx::Bitmap> m_monitor_bitmap; String m_desktop_wallpaper_path; RefPtr<Gfx::Bitmap> m_desktop_wallpaper_bitmap; String m_desktop_wallpaper_mode; - Gfx::Size m_desktop_resolution; + Gfx::IntSize m_desktop_resolution; Gfx::Color m_desktop_color; }; |