mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:17:34 +00:00
BrowserSettings: Add some icons for it :^)
This commit is contained in:
parent
c22b0bb8b2
commit
a1e1405f26
4 changed files with 13 additions and 0 deletions
BIN
Base/res/icons/32x32/downloads.png
Normal file
BIN
Base/res/icons/32x32/downloads.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
Base/res/icons/32x32/home.png
Normal file
BIN
Base/res/icons/32x32/home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 888 B |
BIN
Base/res/icons/32x32/search-engine.png
Normal file
BIN
Base/res/icons/32x32/search-engine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
|
@ -8,6 +8,7 @@
|
||||||
#include <Applications/BrowserSettings/BrowserSettingsWidgetGML.h>
|
#include <Applications/BrowserSettings/BrowserSettingsWidgetGML.h>
|
||||||
#include <LibConfig/Client.h>
|
#include <LibConfig/Client.h>
|
||||||
#include <LibGUI/JsonArrayModel.h>
|
#include <LibGUI/JsonArrayModel.h>
|
||||||
|
#include <LibGUI/Label.h>
|
||||||
#include <LibGUI/Model.h>
|
#include <LibGUI/Model.h>
|
||||||
|
|
||||||
static String default_homepage_url = "file:///res/html/misc/welcome.html";
|
static String default_homepage_url = "file:///res/html/misc/welcome.html";
|
||||||
|
@ -58,9 +59,15 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
||||||
{
|
{
|
||||||
load_from_gml(browser_settings_widget_gml);
|
load_from_gml(browser_settings_widget_gml);
|
||||||
|
|
||||||
|
auto& homepage_image_label = *find_descendant_of_type_named<GUI::Label>("homepage_image_label");
|
||||||
|
homepage_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/home.png").release_value_but_fixme_should_propagate_errors());
|
||||||
|
|
||||||
m_homepage_url_textbox = find_descendant_of_type_named<GUI::TextBox>("homepage_url_textbox");
|
m_homepage_url_textbox = find_descendant_of_type_named<GUI::TextBox>("homepage_url_textbox");
|
||||||
m_homepage_url_textbox->set_text(Config::read_string("Browser", "Preferences", "Home", default_homepage_url));
|
m_homepage_url_textbox->set_text(Config::read_string("Browser", "Preferences", "Home", default_homepage_url));
|
||||||
|
|
||||||
|
auto& appearance_image_label = *find_descendant_of_type_named<GUI::Label>("appearance_image_label");
|
||||||
|
appearance_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/color-chooser.png").release_value_but_fixme_should_propagate_errors());
|
||||||
|
|
||||||
m_color_scheme_combobox = find_descendant_of_type_named<GUI::ComboBox>("color_scheme_combobox");
|
m_color_scheme_combobox = find_descendant_of_type_named<GUI::ComboBox>("color_scheme_combobox");
|
||||||
m_color_scheme_combobox->set_only_allow_values_from_model(true);
|
m_color_scheme_combobox->set_only_allow_values_from_model(true);
|
||||||
m_color_scheme_combobox->set_model(adopt_ref(*new ColorSchemeModel()));
|
m_color_scheme_combobox->set_model(adopt_ref(*new ColorSchemeModel()));
|
||||||
|
@ -70,6 +77,9 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
||||||
m_show_bookmarks_bar_checkbox = find_descendant_of_type_named<GUI::CheckBox>("show_bookmarks_bar_checkbox");
|
m_show_bookmarks_bar_checkbox = find_descendant_of_type_named<GUI::CheckBox>("show_bookmarks_bar_checkbox");
|
||||||
m_show_bookmarks_bar_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "ShowBookmarksBar", default_show_bookmarks_bar), GUI::AllowCallback::No);
|
m_show_bookmarks_bar_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "ShowBookmarksBar", default_show_bookmarks_bar), GUI::AllowCallback::No);
|
||||||
|
|
||||||
|
auto& search_engine_image_label = *find_descendant_of_type_named<GUI::Label>("search_engine_image_label");
|
||||||
|
search_engine_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/search-engine.png").release_value_but_fixme_should_propagate_errors());
|
||||||
|
|
||||||
m_enable_search_engine_checkbox = find_descendant_of_type_named<GUI::CheckBox>("enable_search_engine_checkbox");
|
m_enable_search_engine_checkbox = find_descendant_of_type_named<GUI::CheckBox>("enable_search_engine_checkbox");
|
||||||
m_search_engine_combobox_group = find_descendant_of_type_named<GUI::Widget>("search_engine_combobox_group");
|
m_search_engine_combobox_group = find_descendant_of_type_named<GUI::Widget>("search_engine_combobox_group");
|
||||||
m_search_engine_combobox = find_descendant_of_type_named<GUI::ComboBox>("search_engine_combobox");
|
m_search_engine_combobox = find_descendant_of_type_named<GUI::ComboBox>("search_engine_combobox");
|
||||||
|
@ -100,6 +110,9 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
||||||
};
|
};
|
||||||
set_search_engine_url(Config::read_string("Browser", "Preferences", "SearchEngine", default_search_engine));
|
set_search_engine_url(Config::read_string("Browser", "Preferences", "SearchEngine", default_search_engine));
|
||||||
|
|
||||||
|
auto& download_image_label = *find_descendant_of_type_named<GUI::Label>("download_image_label");
|
||||||
|
download_image_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/downloads.png").release_value_but_fixme_should_propagate_errors());
|
||||||
|
|
||||||
m_auto_close_download_windows_checkbox = find_descendant_of_type_named<GUI::CheckBox>("auto_close_download_windows_checkbox");
|
m_auto_close_download_windows_checkbox = find_descendant_of_type_named<GUI::CheckBox>("auto_close_download_windows_checkbox");
|
||||||
m_auto_close_download_windows_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "CloseDownloadWidgetOnFinish", default_auto_close_download_windows), GUI::AllowCallback::No);
|
m_auto_close_download_windows_checkbox->set_checked(Config::read_bool("Browser", "Preferences", "CloseDownloadWidgetOnFinish", default_auto_close_download_windows), GUI::AllowCallback::No);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue