Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61552 - in /trunk/gtk: ChangeLog src/pkg/YGPackageSelector.cc src/pkg/ygtkpkgfilterview.cc src/pkg/ygtkpkgfilterview.h src/pkg/ygtkpkghistorydialog.cc src/ygtkrichtext.c
  • From: rpmcruz@xxxxxxxxxxxxxxxx
  • Date: Thu, 01 Apr 2010 02:48:37 -0000
  • Message-id: <E1NxASU-00083Q-6I@xxxxxxxxxxxxxxxx>
Author: rpmcruz
Date: Thu Apr 1 04:48:36 2010
New Revision: 61552

URL: http://svn.opensuse.org/viewcvs/yast?rev=61552&view=rev
Log:
* src/pkg/ygtkpkghistorydialog.cc: added some markup
to the text as requested by Atri.

* src/pkg/ygtkpkgfilterview.cc: aligned number count
to the right.

* src/pkg/YGPackageSelector.cc: aligned tool-box to
the right, and re-positioned it, as requested by Atri.

Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/pkg/YGPackageSelector.cc
trunk/gtk/src/pkg/ygtkpkgfilterview.cc
trunk/gtk/src/pkg/ygtkpkgfilterview.h
trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
trunk/gtk/src/ygtkrichtext.c

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Thu Apr 1 04:48:36 2010
@@ -1,3 +1,14 @@
+2010-04-01 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>
+
+ * src/pkg/ygtkpkghistorydialog.cc: added some markup
+ to the text as requested by Atri.
+
+ * src/pkg/ygtkpkgfilterview.cc: aligned number count
+ to the right.
+
+ * src/pkg/YGPackageSelector.cc: aligned tool-box to
+ the right, and re-positioned it, as requested by Atri.
+
2010-03-31 Ricardo Cruz <rpmcruz@xxxxxxxxxxxxxxxxxxx>

* src/ygtkpkghistorydialog.h/cc: fate#305859 and

Modified: trunk/gtk/src/pkg/YGPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/src/pkg/YGPackageSelector.cc (original)
+++ trunk/gtk/src/pkg/YGPackageSelector.cc Thu Apr 1 04:48:36 2010
@@ -123,19 +123,20 @@
GtkWidget *text = gtk_event_box_new();
gtk_container_add (GTK_CONTAINER (text), m_overview);

+ GtkWidget *list_vbox = gtk_vbox_new (FALSE, 4);
+ gtk_box_pack_start (GTK_BOX (list_vbox), m_list->getWidget(),
TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (list_vbox), m_toolbox, FALSE,
TRUE, 0);
+
GtkWidget *vpaned = gtk_vpaned_new();
- gtk_paned_pack1 (GTK_PANED (vpaned), m_list->getWidget(), TRUE,
FALSE);
+ gtk_paned_pack1 (GTK_PANED (vpaned), list_vbox, TRUE, FALSE);
gtk_paned_pack2 (GTK_PANED (vpaned), text, FALSE, TRUE);
g_signal_connect_after (G_OBJECT (vpaned), "size-allocate",
G_CALLBACK (vpaned_allocate_cb), this);

- GtkWidget *vbox, *_vbox = gtk_vbox_new (FALSE, 0);
+ GtkWidget *_vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (_vbox), hbox, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (_vbox), vpaned, TRUE, TRUE, 0);
- vbox = gtk_vbox_new (FALSE, 8);
- gtk_box_pack_start (GTK_BOX (vbox), _vbox, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), m_toolbox, FALSE, TRUE, 0);
- return vbox;
+ return _vbox;
}

GtkWidget *createSidebar()
@@ -477,7 +478,7 @@
g_list_free (children);

if (toolbox) {
- gtk_box_pack_start (GTK_BOX (m_toolbox), toolbox,
FALSE, TRUE, 0);
+ gtk_box_pack_end (GTK_BOX (m_toolbox), toolbox, FALSE,
TRUE, 0);
gtk_widget_show (m_toolbox);
}
else

Modified: trunk/gtk/src/pkg/ygtkpkgfilterview.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgfilterview.cc?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgfilterview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkgfilterview.cc Thu Apr 1 04:48:36 2010
@@ -67,7 +67,7 @@
gchar *text;
UpdateData *data = (UpdateData *) _data;
gpointer mdata;
- gtk_tree_model_get (model, iter, YGtkPkgFilterModel::TEXT_ORI_COLUMN,
&text,
+ gtk_tree_model_get (model, iter, YGtkPkgFilterModel::TEXT_COLUMN, &text,
YGtkPkgFilterModel::DATA_COLUMN, &mdata, -1);

bool separator = !(*text);
@@ -120,7 +120,7 @@
GtkTreeIter iter;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter, ICON_COLUMN, pixbuf, TEXT_COLUMN,
text,
- TEXT_ORI_COLUMN, text, ENABLED_COLUMN, enabled, VISIBLE_COLUMN,
TRUE,
+ COUNT_NUMBER_COLUMN, "", ENABLED_COLUMN, enabled,
VISIBLE_COLUMN, TRUE,
DATA_COLUMN, data, -1);

if (pixbuf) g_object_unref (pixbuf);
@@ -135,14 +135,10 @@
GtkTreeIter iter;
gtk_tree_model_iter_nth_child (impl->model, &iter, NULL, row);

- gchar *ori_text;
- gtk_tree_model_get (impl->model, &iter, TEXT_ORI_COLUMN, &ori_text, -1);
-
- gchar *text = g_strdup_printf ("%s <small>(%d)</small>", ori_text,
count);
- gtk_list_store_set (store, &iter, TEXT_COLUMN, text,
+ gchar *str = g_strdup_printf ("%d", count);
+ gtk_list_store_set (store, &iter, COUNT_NUMBER_COLUMN, str,
VISIBLE_COLUMN, !hide_if_zero || count > 0, -1);
- g_free (ori_text);
- g_free (text);
+ g_free (str);
}

// Status
@@ -595,8 +591,16 @@
column = gtk_tree_view_column_new_with_attributes (
NULL, renderer, "markup", YGtkPkgFilterModel::TEXT_COLUMN,
"sensitive", YGtkPkgFilterModel::ENABLED_COLUMN, NULL);
- g_object_set (G_OBJECT (renderer), "ellipsize",
- updates ? PANGO_ELLIPSIZE_MIDDLE : PANGO_ELLIPSIZE_END, NULL);
+ g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END,
NULL);
+ gtk_tree_view_column_set_expand (column, TRUE);
+ gtk_tree_view_append_column (view, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes (
+ NULL, renderer, "text", YGtkPkgFilterModel::COUNT_NUMBER_COLUMN,
+ "sensitive", YGtkPkgFilterModel::ENABLED_COLUMN, NULL);
+ g_object_set (G_OBJECT (renderer), "xalign", 1.0, "scale",
PANGO_SCALE_SMALL,
+ "foreground", "#8c8c8c", NULL);
gtk_tree_view_append_column (view, column);

GtkTreeSelection *selection = gtk_tree_view_get_selection (view);

Modified: trunk/gtk/src/pkg/ygtkpkgfilterview.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgfilterview.h?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkgfilterview.h (original)
+++ trunk/gtk/src/pkg/ygtkpkgfilterview.h Thu Apr 1 04:48:36 2010
@@ -20,7 +20,7 @@

struct YGtkPkgFilterModel // abstract
{
- enum Column { ICON_COLUMN, TEXT_COLUMN, TEXT_ORI_COLUMN,
+ enum Column { ICON_COLUMN, TEXT_COLUMN, COUNT_NUMBER_COLUMN,
VISIBLE_COLUMN, ENABLED_COLUMN, DATA_COLUMN, TOTAL_COLUMNS };

YGtkPkgFilterModel();

Modified: trunk/gtk/src/pkg/ygtkpkghistorydialog.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkghistorydialog.cc?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/src/pkg/ygtkpkghistorydialog.cc (original)
+++ trunk/gtk/src/pkg/ygtkpkghistorydialog.cc Thu Apr 1 04:48:36 2010
@@ -10,12 +10,12 @@
#include "YGDialog.h"
#include "ygtkpkghistorydialog.h"
#include <gtk/gtk.h>
-#include "ygtkrichtext.h"
+#include "ygtktextview.h"

#include <zypp/parser/HistoryLogReader.h>
#define FILENAME "/var/log/zypp/history"

-static void selection_changed_cb (GtkTreeSelection *selection, YGtkRichText
*text)
+static void selection_changed_cb (GtkTreeSelection *selection, GtkTextView
*text)
{
GtkTreeModel *model;
GtkTreeIter iter;
@@ -23,9 +23,9 @@
char *date;
gtk_tree_model_get (model, &iter, 0, &date, -1);

- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW
(text));
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer (text);
GtkTextMark *mark = gtk_text_buffer_get_mark (buffer, date);
- gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (text), mark, 0,
TRUE, 0, 0);
+ gtk_text_view_scroll_to_mark (text, mark, 0, TRUE, 0, 0);
g_free (date);
}
}
@@ -34,7 +34,12 @@
{
Handler (GtkListStore *store, GtkTextBuffer *buffer)
: store (store), buffer (buffer)
- {}
+ {
+ bold_tag = gtk_text_buffer_create_tag (buffer, "bold",
+ "weight", PANGO_WEIGHT_BOLD, "foreground", "#5c5c5c",
+ "scale", PANGO_SCALE_LARGE, "pixels-below-lines", 6,
+ "pixels-above-lines", 6, NULL);
+ }

bool operator() (const zypp::HistoryItem::Ptr &item)
{
@@ -52,7 +57,8 @@
0, date.c_str(), -1);

gtk_text_buffer_create_mark (buffer, date.c_str(),
&text_iter, TRUE);
- gtk_text_buffer_insert (buffer, &text_iter, (date +
"\n").c_str(), -1);
+ gtk_text_buffer_insert_with_tags (buffer, &text_iter,
+ (date + "\n").c_str(), -1, bold_tag, NULL);
}

std::string line;
@@ -118,12 +124,13 @@
GtkListStore *store;
GtkTextBuffer *buffer;
std::string date;
+ GtkTextTag *bold_tag;
};


YGtkPkgHistoryDialog::YGtkPkgHistoryDialog()
{
- GtkWidget *text = ygtk_rich_text_new();
+ GtkWidget *text = ygtk_text_view_new (FALSE);
GtkWidget *text_scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (text_scroll),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -167,7 +174,7 @@
GtkWidget *hpaned = gtk_hpaned_new();
gtk_paned_pack1 (GTK_PANED (hpaned), date_scroll, FALSE, FALSE);
gtk_paned_pack2 (GTK_PANED (hpaned), text_scroll, TRUE, FALSE);
- gtk_paned_set_position (GTK_PANED (hpaned), 220);
+ gtk_paned_set_position (GTK_PANED (hpaned), 180);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hpaned);

Handler handler (store, gtk_text_view_get_buffer (GTK_TEXT_VIEW
(text)));

Modified: trunk/gtk/src/ygtkrichtext.c
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=61552&r1=61551&r2=61552&view=diff
==============================================================================
--- trunk/gtk/src/ygtkrichtext.c (original)
+++ trunk/gtk/src/ygtkrichtext.c Thu Apr 1 04:48:36 2010
@@ -117,10 +117,6 @@

// Create a few tags like 'h3', 'b', 'i'. others need to be created as
we parse
GtkTextBuffer *buffer = gtk_text_view_get_buffer (tview);
- PangoFontDescription *font_desc = widget->style->font_desc;
- int size = pango_font_description_get_size (font_desc);
- if (pango_font_description_get_size_is_absolute (font_desc))
- size /= PANGO_SCALE;

gboolean reverse = gtk_widget_get_default_direction() ==
GTK_TEXT_DIR_RTL;
const char *left_margin = reverse ? "right-margin" : "left-margin";
@@ -128,24 +124,22 @@

gtk_text_buffer_create_tag (buffer, "body", NULL);
gtk_text_buffer_create_tag (buffer, "h1", "weight", PANGO_WEIGHT_HEAVY,
- "size", (int)(size * PANGO_SCALE_XX_LARGE),
"pixels-below-lines", 16,
+ "scale", PANGO_SCALE_XX_LARGE, "pixels-below-lines", 16,
"foreground", "#5c5c5c", NULL);
gtk_text_buffer_create_tag (buffer, "h2", "weight",
PANGO_WEIGHT_ULTRABOLD,
- "size", (int)(size * PANGO_SCALE_X_LARGE),
"pixels-below-lines", 15,
+ "scale", PANGO_SCALE_X_LARGE, "pixels-below-lines", 15,
"foreground", "#5c5c5c", NULL);
gtk_text_buffer_create_tag (buffer, "h3", "weight", PANGO_WEIGHT_BOLD,
- "size", (int)(size * PANGO_SCALE_LARGE), "pixels-below-lines",
14,
+ "scale", PANGO_SCALE_LARGE, "pixels-below-lines", 14,
"foreground", "#5c5c5c", NULL);
gtk_text_buffer_create_tag (buffer, "h4", "weight",
PANGO_WEIGHT_SEMIBOLD,
- "size", (int)(size * PANGO_SCALE_LARGE), "pixels-below-lines",
13,
+ "scale", PANGO_SCALE_LARGE, "pixels-below-lines", 13,
"foreground", "#5c5c5c", NULL);
gtk_text_buffer_create_tag (buffer, "h5",
- "size", (int)(size * PANGO_SCALE_LARGE), "foreground",
"#5c5c5c", NULL);
+ "scale", PANGO_SCALE_LARGE, "foreground", "#5c5c5c", NULL);
gtk_text_buffer_create_tag (buffer, "p", "pixels-below-lines", 12,
NULL);
- gtk_text_buffer_create_tag (buffer, "big",
- "size", (int)(size * PANGO_SCALE_LARGE),
NULL);
- gtk_text_buffer_create_tag (buffer, "small",
- "size", (int)(size * PANGO_SCALE_SMALL),
NULL);
+ gtk_text_buffer_create_tag (buffer, "big", "scale", PANGO_SCALE_LARGE,
NULL);
+ gtk_text_buffer_create_tag (buffer, "small", "scale",
PANGO_SCALE_SMALL, NULL);
gtk_text_buffer_create_tag (buffer, "tt", "family", "monospace", NULL);
gtk_text_buffer_create_tag (buffer, "pre", "family", "monospace",
"paragraph-background", "#f0f0f0", left_margin, 16,
right_margin, 20, NULL);

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
This Thread
  • No further messages