Blob Blame History Raw
From 51c55bd1f84ce3f7e45a8bb59502392afe8537e6 Mon Sep 17 00:00:00 2001
From: Rafal Luzynski <digitalfreak@lingonborough.com>
Date: Thu, 22 Oct 2015 01:01:28 +0200
Subject: [PATCH] Don't scroll the sidebar horizontally

At the same time some other minor tweaks:
- ellipsize the application name label to make sure it does not
  inflate the sidebar even if the app name is very long,
- add more space between the app name and the problem date
  to make sure they don't adjoin,
- use the CSS formatting in the app name label instead of the markup.

Closes #119
---
 src/gnome_abrt/oops.glade |  2 ++
 src/gnome_abrt/views.py   | 14 ++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gnome_abrt/oops.glade b/src/gnome_abrt/oops.glade
index c11c31d..5188db3 100644
--- a/src/gnome_abrt/oops.glade
+++ b/src/gnome_abrt/oops.glade
@@ -294,6 +294,8 @@
                       <object class="GtkScrolledWindow" id="scrolledwindow1">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">never</property>
+                        <property name="vscrollbar_policy">automatic</property>
                         <child>
                           <object class="GtkViewport" id="viewport1">
                             <property name="visible">True</property>
diff --git a/src/gnome_abrt/views.py b/src/gnome_abrt/views.py
index 8cf7e26..40abb99 100644
--- a/src/gnome_abrt/views.py
+++ b/src/gnome_abrt/views.py
@@ -33,6 +33,8 @@ from gi.repository import Gdk
 from gi.repository import GObject
 #pylint: disable=E0611
 from gi.repository import Gio
+#pylint: disable=E0611
+from gi.repository import Pango
 
 import gnome_abrt.problems as problems
 import gnome_abrt.config as config
@@ -221,13 +223,14 @@ class ProblemListBoxCell(Gtk.Box):
 
         self._problem = problem_values[3]
 
-        self._hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
+        self._hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 12)
 
         self._lbl_app = Gtk.Label.new(problem_values[0])
-        self._lbl_app.set_use_markup(True)
-        self._lbl_app.set_markup("<b>{0}</b>".format(problem_values[0]))
-
         self._lbl_app.set_halign(Gtk.Align.START)
+        self._lbl_app.set_alignment(0.0, 0.5)
+        self._lbl_app.set_ellipsize(Pango.EllipsizeMode.END)
+        self._lbl_app.set_width_chars(15)
+        self._lbl_app.get_style_context().add_class('app-name-label')
 
         self._lbl_date = Gtk.Label.new(problem_values[1])
         self._lbl_date.set_halign(Gtk.Align.END)
@@ -423,6 +426,9 @@ class OopsWindow(Gtk.ApplicationWindow):
         css_prv.load_from_data("GtkListBoxRow {\n"
                                "  padding          : 12px;\n"
                                "}\n"
+                               ".app-name-label {\n"
+                               "  font-weight      : bold;\n"
+                               "}\n"
                                ".oops-reason {\n"
                                "  font-size        : 120%;\n"
                                "  font-weight      : bold;\n"
-- 
2.4.3