From 8b21dbb50fdc4b2ea4856cc8313eb8b5823c03e0 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 25 Mar 2010 16:29:11 +0000 Subject: [PATCH] - Make inklevel widget easier to read (bug #576930). --- system-config-printer-inklevel.patch | 72 ++++++++++++++++++++++++++++ system-config-printer.spec | 9 +++- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 system-config-printer-inklevel.patch diff --git a/system-config-printer-inklevel.patch b/system-config-printer-inklevel.patch new file mode 100644 index 0000000..3a05eed --- /dev/null +++ b/system-config-printer-inklevel.patch @@ -0,0 +1,72 @@ +diff -up system-config-printer-1.2.0/gtkinklevel.py.inklevel system-config-printer-1.2.0/gtkinklevel.py +--- system-config-printer-1.2.0/gtkinklevel.py.inklevel 2009-12-03 17:06:22.000000000 +0000 ++++ system-config-printer-1.2.0/gtkinklevel.py 2010-03-25 16:25:55.108235939 +0000 +@@ -1,7 +1,8 @@ + #!/usr/bin/env python + +-## Copyright (C) 2009 Tim Waugh +-## Copyright (C) 2009 Red Hat, Inc. ++## Copyright (C) 2010 Red Hat, Inc. ++## Authors: ++## Tim Waugh + + ## This program is free software; you can redistribute it and/or modify + ## it under the terms of the GNU General Public License as published by +@@ -56,10 +57,9 @@ class GtkInkLevel (gtk.DrawingArea): + ctx.translate (thickness, thickness) + ctx.scale (w - 2 * thickness, h - 2 * thickness) + thickness = max (ctx.device_to_user_distance (thickness, thickness)) +- ctx.set_line_width (thickness) +- self.draw (ctx) ++ self.draw (ctx, thickness) + +- def draw (self, ctx): ++ def draw (self, ctx, thickness): + r = self._color.red / 65535.0 + g = self._color.green / 65535.0 + b = self._color.blue / 65535.0 +@@ -72,6 +72,7 @@ class GtkInkLevel (gtk.DrawingArea): + ctx.curve_to (0.0, 0.5, 0.1, 0.2, 0.5, 0.0) + ctx.close_path () + ctx.set_source_rgb (r, g, b) ++ ctx.set_line_width (thickness) + ctx.stroke_preserve () + if fill_point > 0.0: + grad_width = 0.10 +@@ -90,6 +91,25 @@ class GtkInkLevel (gtk.DrawingArea): + ctx.set_source_rgb (1, 1, 1) + ctx.fill () + ++ ctx.set_line_width (thickness / 2) ++ ++ ctx.move_to (0.03, 0.5) ++ ctx.line_to (0.9, 0.5) ++ ctx.set_source_rgb (r, g, b) ++ ctx.set_dash ([0.1]) ++ ctx.stroke () ++ ++ ctx.move_to (0, 0.75) ++ ctx.line_to (1, 0.75) ++ ctx.set_source_rgb (r, g, b) ++ ctx.set_dash ([0.05]) ++ ctx.stroke () ++ ++ ctx.move_to (0.15, 0.25) ++ ctx.line_to (0.6, 0.25) ++ ctx.set_source_rgb (r, g, b) ++ ctx.stroke () ++ + if __name__ == '__main__': + # Try it out. + import gobject +diff -up system-config-printer-1.2.0/system-config-printer.py.inklevel system-config-printer-1.2.0/system-config-printer.py +--- system-config-printer-1.2.0/system-config-printer.py.inklevel 2010-03-25 16:25:37.904233984 +0000 ++++ system-config-printer-1.2.0/system-config-printer.py 2010-03-25 16:26:07.037359284 +0000 +@@ -2681,6 +2681,7 @@ class GUI(GtkGUI, monitor.Watcher): + vbox = gtk.VBox (spacing=6) + subhbox = gtk.HBox () + inklevel = gtkinklevel.GtkInkLevel (color, level) ++ inklevel.set_tooltip_text ("%d%%" % level) + subhbox.pack_start (inklevel, True, False, 0) + vbox.pack_start (subhbox, False, False, 0) + label = gtk.Label (name) diff --git a/system-config-printer.spec b/system-config-printer.spec index 4768f91..4a431f9 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -7,7 +7,7 @@ Summary: A printer administration tool Name: system-config-printer Version: 1.2.0 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ URL: http://cyberelk.net/tim/software/system-config-printer/ Group: System Environment/Base @@ -26,6 +26,7 @@ Patch6: system-config-printer-cdi-filename.patch Patch7: system-config-printer-reconnect-error.patch Patch8: system-config-printer-downloadable-drivers.patch Patch9: system-config-printer-JobCancel.patch +Patch10: system-config-printer-inklevel.patch Patch100: system-config-printer-pycups-build.patch @@ -114,6 +115,9 @@ printers. # Use new JobCancelPurge cups-pk-helper method (bug #576496). %patch9 -p1 -b .JobCancel +# Make inklevel widget easier to read (bug #576930). +%patch10 -p1 -b .inklevel + pushd pycups-%{pycups_version} # Fixed pycups build with new distutils. @@ -236,6 +240,9 @@ rm -rf %buildroot exit 0 %changelog +* Thu Mar 25 2010 Tim Waugh - 1.2.0-8 +- Make inklevel widget easier to read (bug #576930). + * Wed Mar 24 2010 Tim Waugh - 1.2.0-7 - Use new JobCancelPurge cups-pk-helper method (bug #576496).