Added basic theme support
This commit is contained in:
parent
b020607065
commit
786ff5743f
7 changed files with 1606 additions and 5 deletions
|
|
@ -15,6 +15,8 @@ bin_PROGRAMS = gtk-lumiera
|
|||
gtk_lumiera_SOURCES = \
|
||||
gtk-lumiera.cpp \
|
||||
gtk-lumiera.hpp \
|
||||
window-manager.cpp \
|
||||
window-manager.hpp \
|
||||
workspace/actions.cpp \
|
||||
workspace/actions.hpp \
|
||||
workspace/workspace-window.cpp \
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ namespace dialogs {
|
|||
|
||||
// Add response buttons the the dialog:
|
||||
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
||||
dialog.add_button(/*Gtk::Stock::SAVE*/"Save", Gtk::RESPONSE_OK);
|
||||
dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
|
||||
|
||||
int result = dialog.run();
|
||||
g_message("%d", result);
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@
|
|||
* *****************************************************/
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
#endif
|
||||
|
||||
#include "gtk-lumiera.hpp"
|
||||
#include "window-manager.hpp"
|
||||
#include "workspace/workspace-window.hpp"
|
||||
#include "model/project.hpp"
|
||||
|
||||
|
|
@ -57,6 +57,10 @@ namespace gui {
|
|||
Glib::set_application_name(AppTitle);
|
||||
|
||||
Project project;
|
||||
WindowManager window_manager;
|
||||
|
||||
window_manager.set_theme("lumiera_ui.rc");
|
||||
|
||||
WorkspaceWindow main_window(&project);
|
||||
|
||||
kit.run(main_window);
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
/** @file gtk-lumiera.hpp
|
||||
** This file contains application wide global definitions
|
||||
** user actions.
|
||||
** @see main.cpp
|
||||
** @see gtk-lumiera.cpp
|
||||
*/
|
||||
|
||||
#ifndef GTK_LUMIERA_HPP
|
||||
#define GTK_LUMIERA_HPO
|
||||
#define GTK_LUMIERA_HPP
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
|
|
@ -92,6 +92,6 @@ namespace gui {
|
|||
} // namespace gui
|
||||
} // namespace lumiera
|
||||
|
||||
#endif
|
||||
#endif // GTK_LUMIERA_HPP
|
||||
|
||||
|
||||
|
|
|
|||
1496
gui/src/lumiera_ui.rc
Normal file
1496
gui/src/lumiera_ui.rc
Normal file
File diff suppressed because it is too large
Load diff
48
gui/src/window-manager.cpp
Normal file
48
gui/src/window-manager.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
window-manager.cpp - Defines the global UI Manager class
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
#include "window-manager.hpp"
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
|
||||
WindowManager::WindowManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool WindowManager::set_theme(Glib::ustring path)
|
||||
{
|
||||
if(access(path.c_str(), R_OK))
|
||||
{
|
||||
g_error("WindowManger: Unable to load rc file \"%s\"", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
Gtk::RC rc(path);
|
||||
gtk_rc_reset_styles (gtk_settings_get_default());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
} // namespace lumiera
|
||||
51
gui/src/window-manager.hpp
Normal file
51
gui/src/window-manager.hpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
window-manager.hpp - Defines the global UI Manager class
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
/** @file window-manager.hpp
|
||||
** This file contains the of global UI Manager class
|
||||
** user actions.
|
||||
** @see window-manager.cpp
|
||||
** @see gtk-lumiera.hpp
|
||||
*/
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#ifndef WINDOW_MANAGER_HPP
|
||||
#define WINDOW_MANAGER_HPP
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
|
||||
class WindowManager
|
||||
{
|
||||
public:
|
||||
WindowManager();
|
||||
|
||||
bool set_theme(Glib::ustring path);
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
} // namespace lumiera
|
||||
|
||||
#endif // WINDOW_MANAGER_HPP
|
||||
Loading…
Reference in a new issue