From 61316147210feca8e539232f76be5edfabf6a986 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 7 Mar 2023 17:06:37 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B8=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 2 +- source/ublexec.cc | 11 +++-------- source/ublexec.h | 2 ++ style.css | 2 +- ublexec.glade | 10 ++++++++++ 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8883823..543d234 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -10,7 +10,7 @@ add_definitions(${GTK_CFLAGS_OTHER}) find_package(Threads REQUIRED) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always -g") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wmissing-declarations -fdiagnostics-color=always") set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/source/ublexec.cc b/source/ublexec.cc index 6f320eb..eb988b1 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -400,13 +400,7 @@ void MainWindow::tempalte_row(string Name, string Exec, string path , Glib::Ref Gtk::TreeModel::Row row = *(dtk_list->append()); row[m_Columns.m_col_filename] = path; row[m_Columns.m_col_description] = Name; - if (std::ifstream(path)){ - row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); - } - else{ - path = "/usr/share/icons/Faenza/emblems/16/emblem-danger.png"; - row[m_Columns.m_col_pixbuf] = Gdk::Pixbuf::create_from_file(path); - } + row[m_Columns.icon_name] = path; row[m_Columns.app_name_exec] = Exec; row[m_Columns.float_h_align] = 0.5; row[m_Columns.float_w_align] = 0.5; @@ -426,7 +420,8 @@ void MainWindow::open_list_app(){ string path = ""; for ( const auto &st_app : list_app){ for ( const auto &str_categor : st_app.Categories){ - path = "/usr/share/icons/hicolor/16x16/apps/" + st_app.Icon + ".png"; + path = st_app.Icon; + //path = "/usr/share/icons/hicolor/16x16/apps/" + st_app.Icon + ".png"; if (str_categor=="Graphics"){ this->tempalte_row(st_app.Name,st_app.Exec, path, list_Graphics); } diff --git a/source/ublexec.h b/source/ublexec.h index fd32684..d5c27ff 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -104,9 +104,11 @@ public: add(app_name_exec); add(float_h_align); add(float_w_align); + add(icon_name); } Gtk::TreeModelColumn m_col_filename; + Gtk::TreeModelColumn icon_name; Gtk::TreeModelColumn m_col_description; Gtk::TreeModelColumn app_name_exec; Gtk::TreeModelColumn > m_col_pixbuf; diff --git a/style.css b/style.css index 5b6b638..751f019 100644 --- a/style.css +++ b/style.css @@ -67,4 +67,4 @@ border-left-width:1px; border-top-width:1px; border-right-width:1px; -} \ No newline at end of file +} diff --git a/ublexec.glade b/ublexec.glade index d50abd3..aced788 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -142,6 +142,7 @@ 5 5 + 6 2 @@ -215,6 +216,7 @@ 5 5 + 6 2 @@ -292,6 +294,7 @@ 5 5 + 6 2 @@ -368,6 +371,7 @@ 5 5 + 6 2 @@ -444,6 +448,7 @@ 5 5 + 6 2 @@ -520,6 +525,7 @@ 5 5 + 6 2 @@ -596,6 +602,7 @@ 5 5 + 6 2 @@ -672,6 +679,7 @@ 5 5 + 6 2 @@ -748,6 +756,7 @@ 5 5 + 6 2 @@ -824,6 +833,7 @@ 5 5 + 6 2