Update gtk112

This commit is contained in:
daleclack 2022-02-01 16:36:28 +08:00
parent 74931d4639
commit f374edeb29
4 changed files with 15 additions and 6 deletions

View File

@ -0,0 +1,6 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<defs>
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color:#363636; } .ColorScheme-Text { color:#363636; }</style>
</defs>
<path d="m2 1c-1.108 0-2 0.892-2 2v9c0 1.108 0.892 2 2 2h12c1.108 0 2-0.892 2-2v-9c0-1.108-0.892-2-2-2zm0 1h12c0.554 0 1 0.446 1 1v9l-5-5-3.4794 4-2.5206-2-3 3v-9c0-0.554 0.446-1 1-1zm2.5 2c-0.82843 0-1.5 0.67157-1.5 1.5s0.67157 1.5 1.5 1.5 1.5-0.67157 1.5-1.5-0.67157-1.5-1.5-1.5z" style="fill:currentColor" class="ColorScheme-Text"/>
</svg>

After

Width:  |  Height:  |  Size: 592 B

View File

@ -26,7 +26,8 @@ set(RESOURCE_LIST
icons/16x16/actions/list-add.svg
icons/16x16/actions/list-remove.svg
folder.svg
folder-images.svg)
folder-images.svg
image_file.svg)
compile_gresources(RESOURCE_FILE
XML_OUT

View File

@ -36,6 +36,9 @@ MyPrefs::MyPrefs()
pixbuf = Gdk::Pixbuf::create_from_resource("/org/gtk/daleclack/folder-images.svg");
image_pixbuf = pixbuf->scale_simple(24, 24, Gdk::INTERP_BILINEAR);
pixbuf.reset();
pixbuf = Gdk::Pixbuf::create_from_resource("/org/gtk/daleclack/image_file.svg");
imagefile_pixbuf = pixbuf->scale_simple(24, 24, Gdk::INTERP_BILINEAR);
pixbuf.reset();
// Add Default Value for folders view
auto row = *(folders_store->append());
@ -162,13 +165,13 @@ void MyPrefs::default_folders_view()
row[n_columns.m_col_path] = ":1";
row[n_columns.m_col_name] = "winpe.xpm";
row[n_columns.m_col_internal] = true;
row[n_columns.m_col_pixbuf] = image_pixbuf;
row[n_columns.m_col_pixbuf] = imagefile_pixbuf;
row = *(images_store->append());
row[n_columns.m_col_path] = ":2";
row[n_columns.m_col_name] = "img7.xpm";
row[n_columns.m_col_internal] = true;
row[n_columns.m_col_pixbuf] = image_pixbuf;
row[n_columns.m_col_pixbuf] = imagefile_pixbuf;
}
int MyPrefs::sort_func(const Gtk::TreeModel::iterator &a, const Gtk::TreeModel::iterator &b)
@ -223,7 +226,6 @@ void MyPrefs::update_images_view(std::string &folder_path)
display_name = Glib::filename_to_utf8(filename);
// Filter the file
// Get Pattern of the file
file_valid = false;
size_t pos = filename.find_last_of('.');
@ -248,7 +250,7 @@ void MyPrefs::update_images_view(std::string &folder_path)
row[n_columns.m_col_path] = pathname;
row[n_columns.m_col_name] = display_name;
row[n_columns.m_col_internal] = false;
row[n_columns.m_col_pixbuf] = image_pixbuf;
row[n_columns.m_col_pixbuf] = imagefile_pixbuf;
}
} while (filename != "");

View File

@ -41,7 +41,7 @@ private:
Gtk::Button btnadd, btnremove;
// Folder Open Dialog
Glib::RefPtr<Gdk::Pixbuf> folder_pixbuf, image_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> folder_pixbuf, image_pixbuf, imagefile_pixbuf;
Glib::RefPtr<Gtk::FileChooserNative> dialog;
void dialog_response(int response_id);