From c800f22fd0692b9c4ae62ae6c3fae7f8c3cb3070 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 3 Oct 2007 18:12:47 +0000 Subject: Apply/tweak patch from larsl to apply matching style to embedded GUIs. git-svn-id: http://svn.drobilla.net/lad/ingen@808 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/App.cpp | 21 ++++++++++++++++++++- src/libs/gui/NodeModule.cpp | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index dc3db30d..8c7c365c 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -110,10 +110,11 @@ App::run(int argc, char** argv, if (!_instance) _instance = new App(world); - /* Load settings */ + // Load configuration settings _instance->configuration()->load_settings(); _instance->configuration()->apply_settings(); + // Set default window icon const Glib::ustring icon_path = PKGDATADIR "/ingen.svg"; try { if (Glib::file_test(icon_path, Glib::FILE_TEST_EXISTS)) @@ -122,6 +123,24 @@ App::run(int argc, char** argv, cerr << "Unable to load window icon " << icon_path << ": " << err.what() << endl; } + // Set style for embedded node GUIs + const string rc_style = + "style \"ingen_embedded_node_gui_style\" {" + " bg[NORMAL] = \"#212222\"" + " bg[ACTIVE] = \"#505050\"" + " bg[PRELIGHT] = \"#525454\"" + " bg[SELECTED] = \"#99A0A0\"" + " bg[INSENSITIVE] = \"#F03030\"" + " fg[NORMAL] = \"#FFFFFF\"" + " fg[ACTIVE] = \"#FFFFFF\"" + " fg[PRELIGHT] = \"#FFFFFF\"" + " fg[SELECTED] = \"#FFFFFF\"" + " fg[INSENSITIVE] = \"#FFFFFF\"" + "}\n" + "widget \"*ingen_embedded_node_gui_container*\" style \"ingen_embedded_node_gui_style\"\n"; + + Gtk::RC::parse_string(rc_style); + App::instance().connect_window()->start(engine, interface); main.run(); diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 7e183377..e6c09e0c 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -135,6 +135,8 @@ NodeModule::embed_gui(bool embed) //container = new Gtk::Alignment(); // transparent bg but uber slow container = new Gtk::EventBox(); + container->set_name("ingen_embedded_node_gui_container"); + container->set_border_width(2); container->add(*_gui); container->show_all(); /*Gdk::Color color; @@ -190,6 +192,11 @@ NodeModule::embed_gui(bool embed) if ((*p)->is_control() && (*p)->is_output()) App::instance().engine()->disable_port_broadcasting((*p)->path()); } + + if (embed && _gui_item) + set_base_color(0x212222FF); + else + set_default_base_color(); resize(); } -- cgit v1.2.1