From f374edeb295e99e56781ce96f9e4bd23b99cf250 Mon Sep 17 00:00:00 2001 From: daleclack Date: Tue, 1 Feb 2022 16:36:28 +0800 Subject: [PATCH] Update gtk112 --- Gtkmm3/default_res/image_file.svg | 6 ++++++ Gtkmm3/gtk122_backprefs/CMakeLists.txt | 3 ++- Gtkmm3/gtk122_backprefs/src/MyPrefs.cc | 10 ++++++---- Gtkmm3/gtk122_backprefs/src/MyPrefs.hh | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 Gtkmm3/default_res/image_file.svg diff --git a/Gtkmm3/default_res/image_file.svg b/Gtkmm3/default_res/image_file.svg new file mode 100644 index 0000000..092f227 --- /dev/null +++ b/Gtkmm3/default_res/image_file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Gtkmm3/gtk122_backprefs/CMakeLists.txt b/Gtkmm3/gtk122_backprefs/CMakeLists.txt index cb34598..0743ff7 100644 --- a/Gtkmm3/gtk122_backprefs/CMakeLists.txt +++ b/Gtkmm3/gtk122_backprefs/CMakeLists.txt @@ -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 diff --git a/Gtkmm3/gtk122_backprefs/src/MyPrefs.cc b/Gtkmm3/gtk122_backprefs/src/MyPrefs.cc index d10917d..b33e448 100644 --- a/Gtkmm3/gtk122_backprefs/src/MyPrefs.cc +++ b/Gtkmm3/gtk122_backprefs/src/MyPrefs.cc @@ -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 != ""); diff --git a/Gtkmm3/gtk122_backprefs/src/MyPrefs.hh b/Gtkmm3/gtk122_backprefs/src/MyPrefs.hh index 48a1be1..89a6443 100644 --- a/Gtkmm3/gtk122_backprefs/src/MyPrefs.hh +++ b/Gtkmm3/gtk122_backprefs/src/MyPrefs.hh @@ -41,7 +41,7 @@ private: Gtk::Button btnadd, btnremove; // Folder Open Dialog - Glib::RefPtr folder_pixbuf, image_pixbuf; + Glib::RefPtr folder_pixbuf, image_pixbuf, imagefile_pixbuf; Glib::RefPtr dialog; void dialog_response(int response_id);