BrowserSettings: Add some icons for it :^)
This commit is contained in:
parent
c22b0bb8b2
commit
a1e1405f26
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a1e1405f263 Pull-request: https://github.com/SerenityOS/serenity/pull/11072
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 <LibConfig/Client.h>
|
||||
#include <LibGUI/JsonArrayModel.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Model.h>
|
||||
|
||||
static String default_homepage_url = "file:///res/html/misc/welcome.html";
|
||||
|
@ -58,9 +59,15 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
|||
{
|
||||
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->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->set_only_allow_values_from_model(true);
|
||||
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->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_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");
|
||||
|
@ -100,6 +110,9 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
|||
};
|
||||
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->set_checked(Config::read_bool("Browser", "Preferences", "CloseDownloadWidgetOnFinish", default_auto_close_download_windows), GUI::AllowCallback::No);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue