mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
More work on changing parameters for functions that accept and return
* components/news/nautilus-news.c: * libnautilus-extensions/nautilus-icon-canvas-item.c: * src/nautilus-about.c: * src/nautilus-sidebar-tabs.c: More work on changing parameters for functions that accept and return ArtIRect, EelArtIPoint, ArtDRect, EelDimensions to pass by value instead of by pointer.
This commit is contained in:
parent
735b256fab
commit
bf4553da38
6 changed files with 138 additions and 116 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2001-05-01 Ramiro Estrugo <ramiro@eazel.com>
|
||||||
|
|
||||||
|
* components/news/nautilus-news.c:
|
||||||
|
* libnautilus-extensions/nautilus-icon-canvas-item.c:
|
||||||
|
* src/nautilus-about.c:
|
||||||
|
* src/nautilus-sidebar-tabs.c:
|
||||||
|
More work on changing parameters for functions that accept and
|
||||||
|
return ArtIRect, EelArtIPoint, ArtDRect, EelDimensions to pass by
|
||||||
|
value instead of by pointer.
|
||||||
|
|
||||||
2001-05-01 Ramiro Estrugo <ramiro@eazel.com>
|
2001-05-01 Ramiro Estrugo <ramiro@eazel.com>
|
||||||
|
|
||||||
* components/mozilla/main.c: (main): Make warnings and criticals
|
* components/mozilla/main.c: (main): Make warnings and criticals
|
||||||
|
|
|
@ -470,9 +470,10 @@ draw_rss_logo_image (RSSChannelData *channel_data,
|
||||||
if (time_x_pos >= LOGO_LEFT_OFFSET + logo_width) {
|
if (time_x_pos >= LOGO_LEFT_OFFSET + logo_width) {
|
||||||
time_y_pos = offset + ((gdk_pixbuf_get_height (channel_data->logo_image) - time_dimensions.height) / 2);
|
time_y_pos = offset + ((gdk_pixbuf_get_height (channel_data->logo_image) - time_dimensions.height) / 2);
|
||||||
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
|
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
|
||||||
time_x_pos, time_y_pos,
|
time_x_pos, time_y_pos,
|
||||||
NULL, TIME_FONT_SIZE, time_str, strlen (time_str),
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
EEL_RGB_COLOR_BLACK, EEL_OPACITY_FULLY_OPAQUE);
|
TIME_FONT_SIZE, time_str, strlen (time_str),
|
||||||
|
EEL_RGB_COLOR_BLACK, EEL_OPACITY_FULLY_OPAQUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -510,7 +511,7 @@ draw_rss_title (RSSChannelData *channel_data,
|
||||||
if (!measure_only) {
|
if (!measure_only) {
|
||||||
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
|
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
|
||||||
label_offset, v_offset,
|
label_offset, v_offset,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
18,
|
18,
|
||||||
channel_data->title, strlen (channel_data->title),
|
channel_data->title, strlen (channel_data->title),
|
||||||
EEL_RGB_COLOR_BLACK,
|
EEL_RGB_COLOR_BLACK,
|
||||||
|
@ -680,7 +681,9 @@ nautilus_news_update_display (News *news_data, gboolean measure_only)
|
||||||
return v_offset;
|
return v_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (news_data->pixbuf, NULL, NEWS_BACKGROUND_RGBA);
|
eel_gdk_pixbuf_fill_rectangle_with_color (news_data->pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
|
NEWS_BACKGROUND_RGBA);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop through the channel list, drawing one channel at a time */
|
/* loop through the channel list, drawing one channel at a time */
|
||||||
|
@ -712,7 +715,9 @@ nautilus_news_configure_event (GtkWidget *widget, GdkEventConfigure *event, News
|
||||||
news_data->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
|
news_data->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
|
||||||
widget->allocation.width, widget->allocation.height);
|
widget->allocation.width, widget->allocation.height);
|
||||||
|
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (news_data->pixbuf, NULL, NEWS_BACKGROUND_RGBA);
|
eel_gdk_pixbuf_fill_rectangle_with_color (news_data->pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
|
NEWS_BACKGROUND_RGBA);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1693,12 +1693,14 @@ draw_label_text_aa (NautilusIconCanvasItem *icon_item, GnomeCanvasBuf *buf, int
|
||||||
icon_item->details->text_height);
|
icon_item->details->text_height);
|
||||||
if (needs_highlight) {
|
if (needs_highlight) {
|
||||||
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
|
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
container->details->highlight_color);
|
container->details->highlight_color);
|
||||||
clear_rounded_corners (text_pixbuf, container->details->highlight_frame, 5);
|
clear_rounded_corners (text_pixbuf, container->details->highlight_frame, 5);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
|
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
EEL_RGBA_COLOR_PACK (0, 0, 0, 0));
|
EEL_RGBA_COLOR_PACK (0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1693,12 +1693,14 @@ draw_label_text_aa (NautilusIconCanvasItem *icon_item, GnomeCanvasBuf *buf, int
|
||||||
icon_item->details->text_height);
|
icon_item->details->text_height);
|
||||||
if (needs_highlight) {
|
if (needs_highlight) {
|
||||||
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
container = NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (icon_item)->canvas);
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
|
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
container->details->highlight_color);
|
container->details->highlight_color);
|
||||||
clear_rounded_corners (text_pixbuf, container->details->highlight_frame, 5);
|
clear_rounded_corners (text_pixbuf, container->details->highlight_frame, 5);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf, NULL,
|
eel_gdk_pixbuf_fill_rectangle_with_color (text_pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
EEL_RGBA_COLOR_PACK (0, 0, 0, 0));
|
EEL_RGBA_COLOR_PACK (0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ nautilus_about_repaint (GtkWidget *widget,
|
||||||
/* draw the background image */
|
/* draw the background image */
|
||||||
if (about->details->background_pixbuf != NULL) {
|
if (about->details->background_pixbuf != NULL) {
|
||||||
draw_pixbuf (about->details->background_pixbuf,
|
draw_pixbuf (about->details->background_pixbuf,
|
||||||
widget->window, 0, 0);
|
widget->window, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,16 +243,17 @@ draw_aa_string (EelScalableFont *font,
|
||||||
{
|
{
|
||||||
if (shadow_offset != 0) {
|
if (shadow_offset != 0) {
|
||||||
eel_scalable_font_draw_text (font, pixbuf,
|
eel_scalable_font_draw_text (font, pixbuf,
|
||||||
x_pos + shadow_offset, y_pos + shadow_offset,
|
x_pos + shadow_offset, y_pos + shadow_offset,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
font_size,
|
font_size,
|
||||||
text, strlen (text),
|
text, strlen (text),
|
||||||
shadow_color, EEL_OPACITY_FULLY_OPAQUE);
|
shadow_color, EEL_OPACITY_FULLY_OPAQUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
eel_scalable_font_draw_text (font, pixbuf, x_pos, y_pos, NULL,
|
eel_scalable_font_draw_text (font, pixbuf, x_pos, y_pos,
|
||||||
font_size,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
text, strlen (text), color, EEL_OPACITY_FULLY_OPAQUE);
|
font_size,
|
||||||
|
text, strlen (text), color, EEL_OPACITY_FULLY_OPAQUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* randomize_authors randomizes the order array so different names get displayed in different positions each time */
|
/* randomize_authors randomizes the order array so different names get displayed in different positions each time */
|
||||||
|
@ -426,7 +427,7 @@ nautilus_about_update_authors (NautilusAbout *about)
|
||||||
|
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color
|
eel_gdk_pixbuf_fill_rectangle_with_color
|
||||||
(about->details->background_pixbuf,
|
(about->details->background_pixbuf,
|
||||||
&author_area,
|
author_area,
|
||||||
EEL_RGBA_COLOR_PACK (255, 255, 255, 255));
|
EEL_RGBA_COLOR_PACK (255, 255, 255, 255));
|
||||||
|
|
||||||
/* randomize the author array */
|
/* randomize the author array */
|
||||||
|
|
|
@ -388,8 +388,8 @@ nautilus_sidebar_tabs_destroy (GtkObject *object)
|
||||||
|
|
||||||
/* release the tab list, if any */
|
/* release the tab list, if any */
|
||||||
eel_g_list_free_deep_custom (sidebar_tabs->details->tab_items,
|
eel_g_list_free_deep_custom (sidebar_tabs->details->tab_items,
|
||||||
tab_item_destroy_cover,
|
tab_item_destroy_cover,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
|
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
|
||||||
(NautilusPreferencesCallback) nautilus_sidebar_tabs_load_theme_data,
|
(NautilusPreferencesCallback) nautilus_sidebar_tabs_load_theme_data,
|
||||||
|
@ -480,7 +480,7 @@ int nautilus_sidebar_tabs_hit_test (NautilusSidebarTabs *sidebar_tabs, int x, in
|
||||||
rect_ptr = &sidebar_tabs->details->title_rect;
|
rect_ptr = &sidebar_tabs->details->title_rect;
|
||||||
|
|
||||||
if ((x >= rect_ptr->x) && (x < rect_ptr->x + rect_ptr->width) &&
|
if ((x >= rect_ptr->x) && (x < rect_ptr->x + rect_ptr->width) &&
|
||||||
(y >= rect_ptr->y) && (y<rect_ptr->y + rect_ptr->height))
|
(y >= rect_ptr->y) && (y<rect_ptr->y + rect_ptr->height))
|
||||||
return 0;
|
return 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ int nautilus_sidebar_tabs_hit_test (NautilusSidebarTabs *sidebar_tabs, int x, in
|
||||||
* toggle visibility
|
* toggle visibility
|
||||||
*/
|
*/
|
||||||
if ((x >= rect_ptr->x) && (x < rect_ptr->x + rect_ptr->width) &&
|
if ((x >= rect_ptr->x) && (x < rect_ptr->x + rect_ptr->width) &&
|
||||||
(y >= rect_ptr->y) && (y< rect_ptr->y + rect_ptr->height))
|
(y >= rect_ptr->y) && (y< rect_ptr->y + rect_ptr->height))
|
||||||
result = tab_item->notebook_page;
|
result = tab_item->notebook_page;
|
||||||
|
|
||||||
current_item = current_item->next;
|
current_item = current_item->next;
|
||||||
|
@ -549,10 +549,10 @@ nautilus_sidebar_tabs_size_allocate(GtkWidget *widget, GtkAllocation *allocation
|
||||||
measure_total_height (sidebar_tabs);
|
measure_total_height (sidebar_tabs);
|
||||||
|
|
||||||
if (!sidebar_tabs->details->title_mode) {
|
if (!sidebar_tabs->details->title_mode) {
|
||||||
gint delta_height = widget->allocation.height - (sidebar_tabs->details->total_height + TAB_TOP_GAP);
|
gint delta_height = widget->allocation.height - (sidebar_tabs->details->total_height + TAB_TOP_GAP);
|
||||||
widget->allocation.height -= delta_height;
|
widget->allocation.height -= delta_height;
|
||||||
widget->allocation.y += delta_height;
|
widget->allocation.y += delta_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convenience routine to composite an image with the proper clipping */
|
/* convenience routine to composite an image with the proper clipping */
|
||||||
|
@ -579,7 +579,7 @@ pixbuf_composite (GdkPixbuf *source, GdkPixbuf *destination, int x_offset, int y
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_pixbuf_composite (source, destination, x_offset, y_offset, source_width, source_height,
|
gdk_pixbuf_composite (source, destination, x_offset, y_offset, source_width, source_height,
|
||||||
float_x_offset, float_y_offset, 1.0, 1.0, GDK_PIXBUF_ALPHA_BILEVEL, alpha);
|
float_x_offset, float_y_offset, 1.0, 1.0, GDK_PIXBUF_ALPHA_BILEVEL, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw a single tab using the default, non-themed approach */
|
/* draw a single tab using the default, non-themed approach */
|
||||||
|
@ -606,9 +606,9 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
|
||||||
|
|
||||||
/* measure the name and compute the bounding box */
|
/* measure the name and compute the bounding box */
|
||||||
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name,
|
tab_name,
|
||||||
strlen (tab_name));
|
strlen (tab_name));
|
||||||
|
|
||||||
total_width = name_dimensions.width + indicator_width + 2 * TAB_MARGIN;
|
total_width = name_dimensions.width + indicator_width + 2 * TAB_MARGIN;
|
||||||
|
|
||||||
|
@ -646,7 +646,9 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
|
||||||
|
|
||||||
/* allocate the pixbuf and fill it with the background color */
|
/* allocate the pixbuf and fill it with the background color */
|
||||||
temp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, name_dimensions.width + indicator_width + 1, name_dimensions.height + 1);
|
temp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, name_dimensions.width + indicator_width + 1, name_dimensions.height + 1);
|
||||||
eel_gdk_pixbuf_fill_rectangle_with_color (temp_pixbuf, NULL, eel_gdk_color_to_rgb (foreground_color));
|
eel_gdk_pixbuf_fill_rectangle_with_color (temp_pixbuf,
|
||||||
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
|
eel_gdk_color_to_rgb (foreground_color));
|
||||||
|
|
||||||
/* draw the indicator if necessary */
|
/* draw the indicator if necessary */
|
||||||
if (indicator_pixbuf) {
|
if (indicator_pixbuf) {
|
||||||
|
@ -655,31 +657,31 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
|
||||||
|
|
||||||
/* draw the name into the pixbuf using anti-aliased text */
|
/* draw the name into the pixbuf using anti-aliased text */
|
||||||
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
|
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
|
||||||
1 + indicator_width, 1,
|
1 + indicator_width, 1,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name, strlen (tab_name),
|
tab_name, strlen (tab_name),
|
||||||
prelight_flag ? EEL_RGB_COLOR_WHITE : EEL_RGB_COLOR_BLACK,
|
prelight_flag ? EEL_RGB_COLOR_WHITE : EEL_RGB_COLOR_BLACK,
|
||||||
EEL_OPACITY_FULLY_OPAQUE);
|
EEL_OPACITY_FULLY_OPAQUE);
|
||||||
|
|
||||||
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
|
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
|
||||||
indicator_width, 0,
|
indicator_width, 0,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name, strlen (tab_name),
|
tab_name, strlen (tab_name),
|
||||||
prelight_flag ? EEL_RGB_COLOR_BLACK : EEL_RGB_COLOR_WHITE,
|
prelight_flag ? EEL_RGB_COLOR_BLACK : EEL_RGB_COLOR_WHITE,
|
||||||
EEL_OPACITY_FULLY_OPAQUE);
|
EEL_OPACITY_FULLY_OPAQUE);
|
||||||
|
|
||||||
/* blit the pixbuf to the drawable, then release it */
|
/* blit the pixbuf to the drawable, then release it */
|
||||||
|
|
||||||
gdk_pixbuf_render_to_drawable_alpha (temp_pixbuf,
|
gdk_pixbuf_render_to_drawable_alpha (temp_pixbuf,
|
||||||
widget->window,
|
widget->window,
|
||||||
0, 0,
|
0, 0,
|
||||||
x + TAB_MARGIN, y + 5,
|
x + TAB_MARGIN, y + 5,
|
||||||
name_dimensions.width + indicator_width + 1, name_dimensions.height + 1,
|
name_dimensions.width + indicator_width + 1, name_dimensions.height + 1,
|
||||||
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
||||||
GDK_RGB_DITHER_MAX,
|
GDK_RGB_DITHER_MAX,
|
||||||
0, 0);
|
0, 0);
|
||||||
|
|
||||||
gdk_pixbuf_unref (temp_pixbuf);
|
gdk_pixbuf_unref (temp_pixbuf);
|
||||||
|
|
||||||
|
@ -741,10 +743,10 @@ draw_tab_piece_aa (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *dest_pixbuf, in
|
||||||
|
|
||||||
if (x >= 0 && y >= 0 && width > 0 && height > 0) {
|
if (x >= 0 && y >= 0 && width > 0 && height > 0) {
|
||||||
gdk_pixbuf_copy_area (pixbuf,
|
gdk_pixbuf_copy_area (pixbuf,
|
||||||
0, 0,
|
0, 0,
|
||||||
blit_width, blit_height,
|
blit_width, blit_height,
|
||||||
dest_pixbuf,
|
dest_pixbuf,
|
||||||
x, y);
|
x, y);
|
||||||
}
|
}
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
@ -754,9 +756,9 @@ draw_tab_piece_aa (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *dest_pixbuf, in
|
||||||
to do it properly at this time. We draw into an offscreen pixbuf so we can get nice anti-aliased text */
|
to do it properly at this time. We draw into an offscreen pixbuf so we can get nice anti-aliased text */
|
||||||
static int
|
static int
|
||||||
draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, GdkPixbuf *indicator_pixbuf,
|
draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, GdkPixbuf *indicator_pixbuf,
|
||||||
char *tab_name, int x, int y, gboolean prelight_flag,
|
char *tab_name, int x, int y, gboolean prelight_flag,
|
||||||
gboolean first_flag, gboolean prev_invisible, int text_h_offset,
|
gboolean first_flag, gboolean prev_invisible, int text_h_offset,
|
||||||
GdkRectangle *tab_rect)
|
GdkRectangle *tab_rect)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
EelDimensions name_dimensions;
|
EelDimensions name_dimensions;
|
||||||
|
@ -787,9 +789,9 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
|
||||||
|
|
||||||
/* measure the size of the name */
|
/* measure the size of the name */
|
||||||
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name,
|
tab_name,
|
||||||
strlen (tab_name));
|
strlen (tab_name));
|
||||||
/* draw the left edge piece */
|
/* draw the left edge piece */
|
||||||
current_pos = x - widget->allocation.x;
|
current_pos = x - widget->allocation.x;
|
||||||
if (first_flag) {
|
if (first_flag) {
|
||||||
|
@ -823,22 +825,22 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
|
||||||
}
|
}
|
||||||
|
|
||||||
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
|
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
|
||||||
text_x, text_y,
|
text_x, text_y,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name, strlen (tab_name),
|
tab_name, strlen (tab_name),
|
||||||
EEL_RGB_COLOR_BLACK,
|
EEL_RGB_COLOR_BLACK,
|
||||||
EEL_OPACITY_FULLY_OPAQUE);
|
EEL_OPACITY_FULLY_OPAQUE);
|
||||||
text_x -= 1;
|
text_x -= 1;
|
||||||
text_y -= 1;
|
text_y -= 1;
|
||||||
|
|
||||||
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
|
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
|
||||||
text_x, text_y,
|
text_x, text_y,
|
||||||
NULL,
|
eel_gdk_pixbuf_whole_pixbuf,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
tab_name, strlen (tab_name),
|
tab_name, strlen (tab_name),
|
||||||
EEL_RGB_COLOR_WHITE,
|
EEL_RGB_COLOR_WHITE,
|
||||||
EEL_OPACITY_FULLY_OPAQUE);
|
EEL_OPACITY_FULLY_OPAQUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up the bounds rectangle for later hit-testing */
|
/* set up the bounds rectangle for later hit-testing */
|
||||||
|
@ -895,9 +897,9 @@ get_tab_width (NautilusSidebarTabs *sidebar_tabs, TabItem *this_tab, gboolean is
|
||||||
}
|
}
|
||||||
|
|
||||||
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
|
||||||
sidebar_tabs->details->font_size,
|
sidebar_tabs->details->font_size,
|
||||||
this_tab->tab_text,
|
this_tab->tab_text,
|
||||||
strlen (this_tab->tab_text));
|
strlen (this_tab->tab_text));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
edge_width = 2 * TAB_MARGIN;
|
edge_width = 2 * TAB_MARGIN;
|
||||||
|
@ -942,10 +944,10 @@ draw_pixbuf_tiled_aa (GdkPixbuf *src_pixbuf, GdkPixbuf *dest_pixbuf, int offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_pixbuf_copy_area (src_pixbuf,
|
gdk_pixbuf_copy_area (src_pixbuf,
|
||||||
0, 0,
|
0, 0,
|
||||||
blit_width, blit_height,
|
blit_width, blit_height,
|
||||||
dest_pixbuf,
|
dest_pixbuf,
|
||||||
x, y);
|
x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1060,12 +1062,12 @@ draw_or_layout_all_tabs (NautilusSidebarTabs *sidebar_tabs, gboolean layout_only
|
||||||
if (is_themed) {
|
if (is_themed) {
|
||||||
g_assert (tab_pixbuf != NULL);
|
g_assert (tab_pixbuf != NULL);
|
||||||
draw_one_tab_themed (sidebar_tabs, tab_pixbuf, this_item->indicator_pixbuf, this_item->tab_text, x_pos, y_pos,
|
draw_one_tab_themed (sidebar_tabs, tab_pixbuf, this_item->indicator_pixbuf, this_item->tab_text, x_pos, y_pos,
|
||||||
this_item->prelit, first_flag, prev_invisible,
|
this_item->prelit, first_flag, prev_invisible,
|
||||||
text_h_offset, &this_item->tab_rect);
|
text_h_offset, &this_item->tab_rect);
|
||||||
} else {
|
} else {
|
||||||
g_assert (temp_gc != NULL);
|
g_assert (temp_gc != NULL);
|
||||||
draw_one_tab_plain (sidebar_tabs, temp_gc, this_item->tab_text, this_item->indicator_pixbuf,
|
draw_one_tab_plain (sidebar_tabs, temp_gc, this_item->tab_text, this_item->indicator_pixbuf,
|
||||||
x_pos, y_pos, this_item->prelit, &this_item->tab_rect);
|
x_pos, y_pos, this_item->prelit, &this_item->tab_rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tab_width = get_tab_width (sidebar_tabs, this_item, is_themed, first_flag);
|
tab_width = get_tab_width (sidebar_tabs, this_item, is_themed, first_flag);
|
||||||
|
@ -1129,7 +1131,7 @@ draw_or_layout_all_tabs (NautilusSidebarTabs *sidebar_tabs, gboolean layout_only
|
||||||
while (cur_x_pos < total_width) {
|
while (cur_x_pos < total_width) {
|
||||||
if (!layout_only)
|
if (!layout_only)
|
||||||
draw_tab_piece_aa (sidebar_tabs, tab_pixbuf, cur_x_pos - x,
|
draw_tab_piece_aa (sidebar_tabs, tab_pixbuf, cur_x_pos - x,
|
||||||
last_y_pos - y, total_width, extra_fill);
|
last_y_pos - y, total_width, extra_fill);
|
||||||
cur_x_pos += extra_width;
|
cur_x_pos += extra_width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1176,20 +1178,20 @@ draw_or_layout_all_tabs (NautilusSidebarTabs *sidebar_tabs, gboolean layout_only
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_pixbuf_composite (temp_pixbuf, tab_pixbuf,
|
gdk_pixbuf_composite (temp_pixbuf, tab_pixbuf,
|
||||||
dest_x,
|
dest_x,
|
||||||
dest_y,
|
dest_y,
|
||||||
src_width,
|
src_width,
|
||||||
src_height,
|
src_height,
|
||||||
dest_x,
|
dest_x,
|
||||||
dest_y,
|
dest_y,
|
||||||
1.0, 1.0,
|
1.0, 1.0,
|
||||||
GDK_INTERP_BILINEAR,
|
GDK_INTERP_BILINEAR,
|
||||||
0xFF);
|
0xFF);
|
||||||
} else {
|
} else {
|
||||||
piece_width = draw_tab_piece_aa (sidebar_tabs, tab_pixbuf,
|
piece_width = draw_tab_piece_aa (sidebar_tabs, tab_pixbuf,
|
||||||
last_x_pos + tab_width - widget->allocation.x,
|
last_x_pos + tab_width - widget->allocation.x,
|
||||||
last_y_pos - widget->allocation.y, -1,
|
last_y_pos - widget->allocation.y, -1,
|
||||||
tab_select);
|
tab_select);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prev_item->tab_rect.width = last_x_pos + tab_width + piece_width - prev_item->tab_rect.x;
|
prev_item->tab_rect.width = last_x_pos + tab_width + piece_width - prev_item->tab_rect.x;
|
||||||
|
@ -1206,13 +1208,13 @@ draw_or_layout_all_tabs (NautilusSidebarTabs *sidebar_tabs, gboolean layout_only
|
||||||
if (is_themed) {
|
if (is_themed) {
|
||||||
/* draw the pixbuf onto the widget and release it */
|
/* draw the pixbuf onto the widget and release it */
|
||||||
gdk_pixbuf_render_to_drawable_alpha (tab_pixbuf,
|
gdk_pixbuf_render_to_drawable_alpha (tab_pixbuf,
|
||||||
widget->window,
|
widget->window,
|
||||||
0, 0,
|
0, 0,
|
||||||
widget->allocation.x, widget->allocation.y,
|
widget->allocation.x, widget->allocation.y,
|
||||||
widget->allocation.width, widget->allocation.height,
|
widget->allocation.width, widget->allocation.height,
|
||||||
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
||||||
GDK_RGB_DITHER_MAX,
|
GDK_RGB_DITHER_MAX,
|
||||||
0, 0);
|
0, 0);
|
||||||
|
|
||||||
gdk_pixbuf_unref (tab_pixbuf);
|
gdk_pixbuf_unref (tab_pixbuf);
|
||||||
}
|
}
|
||||||
|
@ -1289,13 +1291,13 @@ nautilus_sidebar_tabs_expose (GtkWidget *widget, GdkEventExpose *event)
|
||||||
|
|
||||||
/* transfer the pixmap to the screen */
|
/* transfer the pixmap to the screen */
|
||||||
gdk_pixbuf_render_to_drawable_alpha (pixbuf,
|
gdk_pixbuf_render_to_drawable_alpha (pixbuf,
|
||||||
widget->window,
|
widget->window,
|
||||||
0, 0,
|
0, 0,
|
||||||
x_pos, y_pos,
|
x_pos, y_pos,
|
||||||
widget->allocation.width, tab_height,
|
widget->allocation.width, tab_height,
|
||||||
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
GDK_PIXBUF_ALPHA_BILEVEL, 128,
|
||||||
GDK_RGB_DITHER_MAX,
|
GDK_RGB_DITHER_MAX,
|
||||||
0, 0);
|
0, 0);
|
||||||
|
|
||||||
gdk_pixbuf_unref (pixbuf);
|
gdk_pixbuf_unref (pixbuf);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1601,7 +1603,7 @@ is_light_color(GdkColor *color)
|
||||||
|
|
||||||
void
|
void
|
||||||
nautilus_sidebar_tabs_set_color (NautilusSidebarTabs *sidebar_tabs,
|
nautilus_sidebar_tabs_set_color (NautilusSidebarTabs *sidebar_tabs,
|
||||||
const char *color_spec)
|
const char *color_spec)
|
||||||
{
|
{
|
||||||
g_return_if_fail (NAUTILUS_IS_SIDEBAR_TABS (sidebar_tabs));
|
g_return_if_fail (NAUTILUS_IS_SIDEBAR_TABS (sidebar_tabs));
|
||||||
g_return_if_fail (color_spec != NULL);
|
g_return_if_fail (color_spec != NULL);
|
||||||
|
@ -1624,8 +1626,8 @@ nautilus_sidebar_tabs_set_color (NautilusSidebarTabs *sidebar_tabs,
|
||||||
|
|
||||||
void
|
void
|
||||||
nautilus_sidebar_tabs_receive_dropped_color (NautilusSidebarTabs *sidebar_tabs,
|
nautilus_sidebar_tabs_receive_dropped_color (NautilusSidebarTabs *sidebar_tabs,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
GtkSelectionData *selection_data)
|
GtkSelectionData *selection_data)
|
||||||
{
|
{
|
||||||
guint16 *channels;
|
guint16 *channels;
|
||||||
char *color_spec;
|
char *color_spec;
|
||||||
|
@ -1674,8 +1676,8 @@ nautilus_sidebar_tabs_set_title_mode (NautilusSidebarTabs *sidebar_tabs, gboolea
|
||||||
|
|
||||||
void
|
void
|
||||||
nautilus_sidebar_tabs_set_visible (NautilusSidebarTabs *sidebar_tabs,
|
nautilus_sidebar_tabs_set_visible (NautilusSidebarTabs *sidebar_tabs,
|
||||||
const char *name,
|
const char *name,
|
||||||
gboolean is_visible)
|
gboolean is_visible)
|
||||||
{
|
{
|
||||||
TabItem *tab_item;
|
TabItem *tab_item;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue