summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2012-08-01 14:58:24 +0200
committerAndrea Azzarone <azzaronea@gmail.com>2012-08-01 14:58:24 +0200
commit29fe6f477c1abacd920b01565648948461debcca (patch)
tree6b854d2b89cbd17808bd88ab59551b1c0d569c30 /unity-shared
parent9ef4a54bed2b795879e01343a16a85e6dd941ab0 (diff)
Add unit test.
(bzr r2527.1.4)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/PanelStyle.cpp13
-rw-r--r--unity-shared/PanelStyle.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/unity-shared/PanelStyle.cpp b/unity-shared/PanelStyle.cpp
index 0f2dd24e1..ff9ca4b74 100644
--- a/unity-shared/PanelStyle.cpp
+++ b/unity-shared/PanelStyle.cpp
@@ -69,6 +69,19 @@ Style::Style()
, _style_context(gtk_style_context_new())
, _gsettings(g_settings_new(SETTINGS_NAME.c_str()))
{
+ Init();
+}
+
+Style::Style(GSettingsBackend* backend)
+ : panel_height(24)
+ , _style_context(gtk_style_context_new())
+ , _gsettings(g_settings_new_with_backend(SETTINGS_NAME.c_str(), backend))
+{
+ Init();
+}
+
+void Style::Init()
+{
if (style_instance)
{
LOG_ERROR(logger) << "More than one panel::Style created.";
diff --git a/unity-shared/PanelStyle.h b/unity-shared/PanelStyle.h
index 397540f6c..fdc5df8e3 100644
--- a/unity-shared/PanelStyle.h
+++ b/unity-shared/PanelStyle.h
@@ -64,6 +64,7 @@ class Style
{
public:
Style();
+ Style(GSettingsBackend* backend);
~Style();
static Style& Instance();
@@ -81,6 +82,7 @@ public:
sigc::signal<void> changed;
private:
+ void Init();
void Refresh();
glib::Object<GtkStyleContext> _style_context;