diff --git a/include/Win_GParted.h b/include/Win_GParted.h index c2cb5b0c..80341317 100644 --- a/include/Win_GParted.h +++ b/include/Win_GParted.h @@ -64,6 +64,7 @@ private: void create_format_menu_add_item( FSType filesystem, bool activate ); void init_device_info() ; void init_hpaned_main() ; + void add_custom_css(); void refresh_combo_devices() ; void show_pulsebar( const Glib::ustring & status_message ) ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 0d82cc82..08924567 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -48,6 +48,7 @@ #include "../config.h" #include +#include #include #include #include @@ -141,6 +142,8 @@ Win_GParted::Win_GParted( const std::vector & user_devices ) //make sure harddisk information is closed.. hpaned_main .get_child1() ->hide() ; + + add_custom_css(); } Win_GParted::~Win_GParted() @@ -669,6 +672,31 @@ void Win_GParted::init_hpaned_main() hpaned_main .pack2( *scrollwindow, true, true ); } +void Win_GParted::add_custom_css() +{ + Glib::RefPtr default_screen = Gdk::Screen::get_default(); + Glib::RefPtr provider = Gtk::CssProvider::create(); + + Glib::ustring custom_css; + if (gtk_get_minor_version() >= 20) + custom_css = "progressbar progress, trough { min-height: 8px; }"; + else + custom_css = "GtkProgressBar { -GtkProgressBar-min-horizontal-bar-height: 8px; }"; + + try + { + provider->load_from_data(custom_css); + } + catch (Glib::Error& e) + { + std::cerr << e.what() << std::endl; + } + + Gtk::StyleContext::add_provider_for_screen(default_screen, + provider, + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); +} + void Win_GParted::refresh_combo_devices() { // Temporarily block the on change callback while re-creating the device list