summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorBrandon Schaefer <brandontschaefer@gmail.com>2012-08-10 15:55:17 -0700
committerBrandon Schaefer <brandontschaefer@gmail.com>2012-08-10 15:55:17 -0700
commit3a6339bbff5402e9b97c6a3ca75c6fbaee6d5233 (patch)
tree40dc126171370ba40a6698c5c07955aaf952f858 /unity-shared
parentfde49a7e789d3ac929b00e1c87934566a0e59fb9 (diff)
parent0c9f0ef0dda3d34abf3de49d98a620614b37d8c1 (diff)
* Merged trunk, fixed conflicts
(bzr r2529.8.6)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/BGHash.cpp2
-rw-r--r--unity-shared/DashStyle.cpp2
-rw-r--r--unity-shared/IconRenderer.cpp5
-rw-r--r--unity-shared/PanelStyle.cpp25
-rw-r--r--unity-shared/PanelStyle.h8
-rw-r--r--unity-shared/PluginAdapterCompiz.cpp2
6 files changed, 19 insertions, 25 deletions
diff --git a/unity-shared/BGHash.cpp b/unity-shared/BGHash.cpp
index 3ccd92e2f..767c8f377 100644
--- a/unity-shared/BGHash.cpp
+++ b/unity-shared/BGHash.cpp
@@ -155,7 +155,6 @@ nux::Color BGHash::MatchColor(nux::Color const& base_color) const
colors[10] = nux::Color (0x1b134c);
colors[11] = nux::Color (0x2c0d46);
- float closest_diff = 200.0f;
nux::Color chosen_color;
nux::color::HueSaturationValue base_hsv (base_color);
@@ -168,6 +167,7 @@ nux::Color BGHash::MatchColor(nux::Color const& base_color) const
}
else
{
+ float closest_diff = 200.0f;
LOG_DEBUG (logger) << "got a colour image";
// full colour image
for (int i = 0; i < 11; i++)
diff --git a/unity-shared/DashStyle.cpp b/unity-shared/DashStyle.cpp
index 789659139..31d997f0f 100644
--- a/unity-shared/DashStyle.cpp
+++ b/unity-shared/DashStyle.cpp
@@ -1648,7 +1648,6 @@ bool Style::SquareButton(cairo_t* cr, nux::ButtonVisualState state,
double height = h - (2.0 * garnish) - 1.0;
bool odd = true;
- double radius = 7.0;
// draw the grid background
{
@@ -1656,6 +1655,7 @@ bool Style::SquareButton(cairo_t* cr, nux::ButtonVisualState state,
cairo_move_to(cr, _align(x + width, odd), y);
if (curve_bottom)
{
+ double radius = 7.0;
LOG_DEBUG(logger) << "curve: " << _align(x + width, odd) << " - " << _align(y + height - radius, odd);
// line to bottom-right corner
cairo_line_to(cr, _align(x + width, odd), _align(y + height - radius, odd));
diff --git a/unity-shared/IconRenderer.cpp b/unity-shared/IconRenderer.cpp
index f8bbbba66..ed1fa65e6 100644
--- a/unity-shared/IconRenderer.cpp
+++ b/unity-shared/IconRenderer.cpp
@@ -250,7 +250,7 @@ void IconRenderer::PreprocessIcons(std::list<RenderArg>& args, nux::Geometry con
std::list<RenderArg>::iterator it;
int i;
- for (it = args.begin(), i = 0; it != args.end(); it++, i++)
+ for (it = args.begin(), i = 0; it != args.end(); ++it, i++)
{
IconTextureSource* launcher_icon = it->icon;
@@ -757,7 +757,6 @@ void IconRenderer::RenderElement(nux::GraphicsEngine& GfxContext,
CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0));
CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
- int TextureObjectLocation;
int VertexLocation;
int TextureCoord0Location;
int FragmentColor = 0;
@@ -768,7 +767,7 @@ void IconRenderer::RenderElement(nux::GraphicsEngine& GfxContext,
{
local::shader_program_uv_persp_correction->Begin();
- TextureObjectLocation = local::shader_program_uv_persp_correction->GetUniformLocationARB("TextureObject0");
+ int TextureObjectLocation = local::shader_program_uv_persp_correction->GetUniformLocationARB("TextureObject0");
VertexLocation = local::shader_program_uv_persp_correction->GetAttributeLocation("iVertex");
TextureCoord0Location = local::shader_program_uv_persp_correction->GetAttributeLocation("iTexCoord0");
FragmentColor = local::shader_program_uv_persp_correction->GetUniformLocationARB("color0");
diff --git a/unity-shared/PanelStyle.cpp b/unity-shared/PanelStyle.cpp
index 2fce4eacf..142095396 100644
--- a/unity-shared/PanelStyle.cpp
+++ b/unity-shared/PanelStyle.cpp
@@ -22,7 +22,6 @@
#include <math.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include <boost/algorithm/string/predicate.hpp>
#include <Nux/Nux.h>
@@ -46,8 +45,8 @@ Style* style_instance = nullptr;
nux::logging::Logger logger("unity.panel.style");
-const std::string METACITY_SETTINGS_PATH("/apps/metacity/general/");
-const std::string PANEL_TITLE_FONT_KEY("/apps/metacity/general/titlebar_font");
+const std::string SETTINGS_NAME("org.gnome.desktop.wm.preferences");
+const std::string PANEL_TITLE_FONT_KEY("titlebar-font");
const std::string HIGH_CONTRAST_THEME_PREFIX("HighContrast");
nux::Color ColorFromGdkRGBA(GdkRGBA const& color)
@@ -63,6 +62,7 @@ nux::Color ColorFromGdkRGBA(GdkRGBA const& color)
Style::Style()
: panel_height(24)
, _style_context(gtk_style_context_new())
+ , _gsettings(g_settings_new(SETTINGS_NAME.c_str()))
{
if (style_instance)
{
@@ -109,14 +109,10 @@ Style::Style()
changed.emit();
});
- GConfClient* client = gconf_client_get_default();
- gconf_client_add_dir(client, METACITY_SETTINGS_PATH.c_str(), GCONF_CLIENT_PRELOAD_NONE, nullptr);
- _gconf_notify_id = gconf_client_notify_add(client, PANEL_TITLE_FONT_KEY.c_str(),
- [] (GConfClient*,guint,GConfEntry*, gpointer data)
- {
- auto self = static_cast<Style*>(data);
- self->changed.emit();
- }, this, nullptr, nullptr);
+ _settings_changed_signal.Connect(_gsettings, "changed::" + PANEL_TITLE_FONT_KEY,
+ [&] (GSettings*, gchar*) {
+ changed.emit();
+ });
Refresh();
}
@@ -125,9 +121,6 @@ Style::~Style()
{
if (style_instance == this)
style_instance = nullptr;
-
- if (_gconf_notify_id)
- gconf_client_notify_remove(gconf_client_get_default(), _gconf_notify_id);
}
Style& Style::Instance()
@@ -371,8 +364,7 @@ std::string Style::GetFontDescription(PanelItem item)
}
case PanelItem::TITLE:
{
- GConfClient* client = gconf_client_get_default();
- glib::String font_name(gconf_client_get_string(client, PANEL_TITLE_FONT_KEY.c_str(), nullptr));
+ glib::String font_name(g_settings_get_string(_gsettings, PANEL_TITLE_FONT_KEY.c_str()));
return font_name.Str();
}
}
@@ -390,3 +382,4 @@ int Style::GetTextDPI()
} // namespace panel
} // namespace unity
+
diff --git a/unity-shared/PanelStyle.h b/unity-shared/PanelStyle.h
index ef86d9800..b5640c18e 100644
--- a/unity-shared/PanelStyle.h
+++ b/unity-shared/PanelStyle.h
@@ -84,12 +84,14 @@ private:
void Refresh();
glib::Object<GtkStyleContext> _style_context;
+ glib::Object<GSettings> _gsettings;
+ std::string _theme_name;
+ nux::Color _text_color;
+
glib::Signal<void, GtkSettings*, GParamSpec*> _style_changed_signal;
glib::Signal<void, GtkSettings*, GParamSpec*> _font_changed_signal;
glib::Signal<void, GtkSettings*, GParamSpec*> _dpi_changed_signal;
- guint _gconf_notify_id;
- std::string _theme_name;
- nux::Color _text_color;
+ glib::Signal<void, GSettings*, gchar*> _settings_changed_signal;
};
}
diff --git a/unity-shared/PluginAdapterCompiz.cpp b/unity-shared/PluginAdapterCompiz.cpp
index 9d4113bdc..92ad4cea3 100644
--- a/unity-shared/PluginAdapterCompiz.cpp
+++ b/unity-shared/PluginAdapterCompiz.cpp
@@ -1016,7 +1016,7 @@ PluginAdapter::CheckWindowIntersections (nux::Geometry const& region, bool &acti
}
else
{
- for (it = window_list.begin(); it != window_list.end(); it++)
+ for (it = window_list.begin(); it != window_list.end(); ++it)
{
if (CheckWindowIntersection(region, *it))
{