diff options
author | Treeki <treeki@gmail.com> | 2010-10-07 15:56:13 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2010-10-07 15:56:13 +0200 |
commit | 5f6dad55d75cbe146ff7fefc899a02ccd39078ba (patch) | |
tree | 0822df14cc6d2c0329810c9ae7b4a4a638fe82b1 /lsglobals.cpp | |
download | LayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.tar.gz LayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.zip |
initial commit -- everything compiles except for material.cpp. the material system still needs quite a bit of work; this will come in due time
Diffstat (limited to '')
-rw-r--r-- | lsglobals.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lsglobals.cpp b/lsglobals.cpp new file mode 100644 index 0000000..66502ee --- /dev/null +++ b/lsglobals.cpp @@ -0,0 +1,47 @@ +#include "lsglobals.h" + +bool LSGlobals::m_loaded = false; +QHash<QString, QIcon> LSGlobals::m_icons; +QHash<QString, QString> LSGlobals::m_pane_icon_names; + + +bool LSGlobals::setup() { + if (m_loaded) + return false; + + + + // Load icons + loadIcon("pane"); + loadIcon("picture"); + loadIcon("textbox"); + loadIcon("bounding"); + loadIcon("window"); + + // Set up pane type mapping + m_pane_icon_names["pan1"] = "pane"; + m_pane_icon_names["pic1"] = "picture"; + m_pane_icon_names["txt1"] = "textbox"; + m_pane_icon_names["bnd1"] = "bounding"; + m_pane_icon_names["wnd1"] = "window"; + + + + m_loaded = true; + return true; +} + + +bool LSGlobals::loadIcon(QString name) { + m_icons[name] = QIcon(QString(":icons/%1").arg(name)); + return true; +} + + +QIcon LSGlobals::getIcon(QString name) { + return m_icons.value(name); +} + +QIcon LSGlobals::getIconForPaneType(QString type) { + return m_icons.value(m_pane_icon_names.value(type)); +} |