Merge lp:~nicovdw/unity/fix-for-759886 into lp:unity

Proposed by Nico van der Walt
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1157
Proposed branch: lp:~nicovdw/unity/fix-for-759886
Merge into: lp:unity
Diff against target: 45 lines (+13/-0)
2 files modified
src/PanelIndicatorObjectEntryView.cpp (+11/-0)
src/PanelIndicatorObjectEntryView.h (+2/-0)
To merge this branch: bzr merge lp:~nicovdw/unity/fix-for-759886
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+57887@code.launchpad.net

Description of the change

added the OnFontChanged method to the PanelIndicatorObjectEntryView class that gets called when the user changed the system font. This method will refresh the indicators to apply the new font.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

(Gord is making the review, just a note: do not forget to reset _on_font_changed_connection to 0 in the callback)

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

forget about my comment, too many g_source_remove yesterday ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/PanelIndicatorObjectEntryView.cpp'
--- src/PanelIndicatorObjectEntryView.cpp 2011-04-06 17:53:41 +0000
+++ src/PanelIndicatorObjectEntryView.cpp 2011-04-15 14:59:23 +0000
@@ -46,6 +46,8 @@
46 _on_indicator_updated_connection = _proxy->updated.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::Refresh));46 _on_indicator_updated_connection = _proxy->updated.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::Refresh));
47 _padding = padding;47 _padding = padding;
4848
49 _on_font_changed_connection = g_signal_connect (gtk_settings_get_default (), "notify::gtk-font-name", (GCallback) &PanelIndicatorObjectEntryView::OnFontChanged, this);
50
49 InputArea::OnMouseDown.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::OnMouseDown));51 InputArea::OnMouseDown.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::OnMouseDown));
50 InputArea::OnMouseWheel.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::OnMouseWheel));52 InputArea::OnMouseWheel.connect (sigc::mem_fun (this, &PanelIndicatorObjectEntryView::OnMouseWheel));
5153
@@ -58,6 +60,7 @@
58 _on_indicator_activate_changed_connection.disconnect ();60 _on_indicator_activate_changed_connection.disconnect ();
59 _on_indicator_updated_connection.disconnect ();61 _on_indicator_updated_connection.disconnect ();
60 _on_panelstyle_changed_connection.disconnect ();62 _on_panelstyle_changed_connection.disconnect ();
63 g_signal_handler_disconnect (gtk_settings_get_default (), _on_font_changed_connection);
61}64}
6265
63void66void
@@ -430,3 +433,11 @@
430{433{
431 return _proxy ? _proxy->show_now : false;434 return _proxy ? _proxy->show_now : false;
432}435}
436
437void
438PanelIndicatorObjectEntryView::OnFontChanged (GObject *gobject, GParamSpec *pspec, gpointer data)
439{
440 PanelIndicatorObjectEntryView *self = (PanelIndicatorObjectEntryView*) data;
441
442 self->Refresh();
443}
433444
=== modified file 'src/PanelIndicatorObjectEntryView.h'
--- src/PanelIndicatorObjectEntryView.h 2011-03-29 12:23:52 +0000
+++ src/PanelIndicatorObjectEntryView.h 2011-04-15 14:59:23 +0000
@@ -61,6 +61,8 @@
61 sigc::connection _on_indicator_updated_connection;61 sigc::connection _on_indicator_updated_connection;
62 sigc::connection _on_panelstyle_changed_connection;62 sigc::connection _on_panelstyle_changed_connection;
6363
64 gulong _on_font_changed_connection;
65 static void OnFontChanged (GObject *gobject, GParamSpec *pspec, gpointer data);
64};66};
6567
66#endif // PANEL_INDICATOR_OBJECT_ENTRY_VIEW_H68#endif // PANEL_INDICATOR_OBJECT_ENTRY_VIEW_H