[meld] ui.notebooklabel/statusbar: Use GtkStyleContext
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] ui.notebooklabel/statusbar: Use GtkStyleContext
- Date: Thu, 2 Jan 2014 20:19:03 +0000 (UTC)
commit caa6e61363da7968e35910a7e2aab8096e4fa793
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Jan 1 09:40:13 2014 +1000
ui.notebooklabel/statusbar: Use GtkStyleContext
meld/ui/notebooklabel.py | 3 ++-
meld/ui/statusbar.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/meld/ui/notebooklabel.py b/meld/ui/notebooklabel.py
index f37e21e..66555b5 100644
--- a/meld/ui/notebooklabel.py
+++ b/meld/ui/notebooklabel.py
@@ -53,7 +53,8 @@ class NotebookLabel(Gtk.HBox):
label.set_padding(0, 0)
context = self.get_pango_context()
- metrics = context.get_metrics(self.get_style().font_desc, context.get_language())
+ font_desc = self.get_style_context().get_font(Gtk.StateFlags.NORMAL)
+ metrics = context.get_metrics(font_desc, context.get_language())
char_width = metrics.get_approximate_char_width() / Pango.SCALE
valid, w, h = Gtk.icon_size_lookup_for_settings(self.get_settings(), Gtk.IconSize.MENU)
# FIXME: PIXELS replacement
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index 157d5ef..7e21217 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -67,7 +67,8 @@ class MeldStatusBar(Gtk.Statusbar):
self.progress.props.pulse_step = 0.02
self.progress.props.ellipsize = Pango.EllipsizeMode.END
self.progress.set_size_request(200, -1)
- progress_font = self.progress.get_style().font_desc
+ progress_font = self.get_style_context().get_font(
+ Gtk.StateFlags.NORMAL)
progress_font.set_size(progress_font.get_size() - 2 * Pango.SCALE)
self.progress.modify_font(progress_font)
hbox.pack_start(self.progress, False, True, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]