[Goodies-commits] r2949 - ristretto/trunk/src
Stephan Arts
stephan at xfce.org
Mon Aug 6 00:20:24 CEST 2007
Author: stephan
Date: 2007-08-05 22:20:24 +0000 (Sun, 05 Aug 2007)
New Revision: 2949
Modified:
ristretto/trunk/src/main.c
ristretto/trunk/src/navigator.c
ristretto/trunk/src/thumbnail_viewer.c
Log:
modified thumbnailer a bit
Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c 2007-08-04 23:46:52 UTC (rev 2948)
+++ ristretto/trunk/src/main.c 2007-08-05 22:20:24 UTC (rev 2949)
@@ -107,7 +107,7 @@
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(s_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
GtkWidget *main_vbox = gtk_vbox_new(0, FALSE);
GtkWidget *main_hbox = gtk_hbox_new(0, FALSE);
- GtkWidget *main_paned = gtk_vpaned_new();
+ GtkWidget *main_vbox1 = gtk_vbox_new(0, FALSE);
GtkWidget *thumbnail_viewer = rstto_thumbnail_viewer_new(navigator);
menu_bar = gtk_menu_bar_new();
image_tool_bar = gtk_toolbar_new();
@@ -174,10 +174,10 @@
gtk_container_add(GTK_CONTAINER(s_window), viewer);
gtk_toolbar_set_orientation(GTK_TOOLBAR(image_tool_bar), GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start(GTK_BOX(main_hbox), image_tool_bar, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(main_hbox), main_paned, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(main_hbox), main_vbox1, TRUE, TRUE, 0);
- gtk_paned_pack1(GTK_PANED(main_paned), s_window, TRUE, TRUE);
- gtk_paned_pack2(GTK_PANED(main_paned), thumbnail_viewer, FALSE, TRUE);
+ gtk_box_pack_start(GTK_BOX(main_vbox1), s_window, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox1), thumbnail_viewer, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), app_tool_bar, FALSE, TRUE, 0);
Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c 2007-08-04 23:46:52 UTC (rev 2948)
+++ ristretto/trunk/src/navigator.c 2007-08-05 22:20:24 UTC (rev 2949)
@@ -314,7 +314,7 @@
entry = g_new0(RsttoNavigatorEntry, 1);
entry->info = info;
- entry->pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 64, 64, NULL);
+ entry->pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 64, 48, NULL);
g_free(filename);
}
Modified: ristretto/trunk/src/thumbnail_viewer.c
===================================================================
--- ristretto/trunk/src/thumbnail_viewer.c 2007-08-04 23:46:52 UTC (rev 2948)
+++ ristretto/trunk/src/thumbnail_viewer.c 2007-08-05 22:20:24 UTC (rev 2949)
@@ -123,7 +123,7 @@
switch(viewer->priv->orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
- requisition->height = 64;
+ requisition->height = 74;
requisition->width = 10;
break;
case GTK_ORIENTATION_VERTICAL:
@@ -222,6 +222,7 @@
break;
}
+ RsttoNavigatorEntry *current_entry = rstto_navigator_get_file(viewer->priv->navigator);
PangoContext *pc = gtk_widget_get_pango_context(widget);
PangoLayout *pl = pango_layout_new(pc);
@@ -243,36 +244,45 @@
ThunarVfsInfo *info = rstto_navigator_entry_get_info(entry);
GdkPixbuf *pixbuf = rstto_navigator_entry_get_thumbnail(entry);
+
pango_layout_set_text(pl, info->display_name, strlen(info->display_name));
if(viewer->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
+ if(current_entry == entry)
+ {
+ color.pixel = 0xff0000ff;
+ }
+ else
+ {
+ color.pixel = 0xffffffff;
+ }
+ gdk_gc_set_foreground(gc, &color);
gdk_draw_rectangle(GDK_DRAWABLE(widget->window),
gc,
TRUE,
- (i*dimension), 0, dimension, dimension);
+ (i*74), 0, 74, 74);
- /*
gdk_draw_rectangle(GDK_DRAWABLE(widget->window),
gc_1,
TRUE,
- (i*dimension)+12, 12, inner_dimension, inner_dimension-12);
- */
+ (i*74)+4, 4, 66 , 50);
+
if(pixbuf)
gdk_draw_pixbuf(GDK_DRAWABLE(widget->window),
gc,
pixbuf,
0, 0,
- i*dimension + 12,
- 12,
+ i * 74 + 5 + (0.5 * (64 - gdk_pixbuf_get_width(pixbuf))),
+ 5 + (0.5 *(48 - gdk_pixbuf_get_height(pixbuf))),
-1, -1,
GDK_RGB_DITHER_NORMAL,
0, 0);
gdk_draw_layout(GDK_DRAWABLE(widget->window),
gc_1,
- (i*dimension)+12, dimension-24,
+ (i*74)+5, 56,
pl);
}
@@ -303,5 +313,9 @@
static void
cb_rstto_thumbnailer_nav_file_changed(RsttoNavigator *nav, RsttoThumbnailViewer *viewer)
{
-
+ if (GTK_WIDGET_REALIZED (viewer))
+ {
+ rstto_thumbnail_viewer_paint(viewer);
+
+ }
}
More information about the Goodies-commits
mailing list