[nautilus: 4/9] views: don't use EelBackground to set sensitive/insensitive bg
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus: 4/9] views: don't use EelBackground to set sensitive/insensitive bg
- Date: Sat, 9 Oct 2010 17:39:41 +0000 (UTC)
commit c185321ed28d8aba69734039211946c739d32467
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Oct 7 11:21:43 2010 +0200
views: don't use EelBackground to set sensitive/insensitive bg
Use an implementation for each view, don't relying on EelBackground.
src/file-manager/fm-empty-view.c | 7 -------
src/file-manager/fm-icon-view.c | 20 +++++++++-----------
src/file-manager/fm-list-view.c | 27 +++++++++------------------
3 files changed, 18 insertions(+), 36 deletions(-)
---
diff --git a/src/file-manager/fm-empty-view.c b/src/file-manager/fm-empty-view.c
index 09a996d..a4ab774 100644
--- a/src/file-manager/fm-empty-view.c
+++ b/src/file-manager/fm-empty-view.c
@@ -89,12 +89,6 @@ fm_empty_view_file_changed (FMDirectoryView *view, NautilusFile *file, NautilusD
{
}
-static GtkWidget *
-fm_empty_view_get_background_widget (FMDirectoryView *view)
-{
- return GTK_WIDGET (view);
-}
-
static GList *
fm_empty_view_get_selection (FMDirectoryView *view)
{
@@ -295,7 +289,6 @@ fm_empty_view_class_init (FMEmptyViewClass *class)
fm_directory_view_class->click_policy_changed = fm_empty_view_click_policy_changed;
fm_directory_view_class->clear = fm_empty_view_clear;
fm_directory_view_class->file_changed = fm_empty_view_file_changed;
- fm_directory_view_class->get_background_widget = fm_empty_view_get_background_widget;
fm_directory_view_class->get_selection = fm_empty_view_get_selection;
fm_directory_view_class->get_selection_for_file_transfer = fm_empty_view_get_selection_for_file_transfer;
fm_directory_view_class->get_item_count = fm_empty_view_get_item_count;
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index b49afc8..7277a9b 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -30,7 +30,6 @@
#include "fm-desktop-icon-view.h"
#include "fm-error-reporting.h"
#include <stdlib.h>
-#include <eel/eel-background.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
@@ -43,7 +42,6 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <libnautilus-private/nautilus-clipboard-monitor.h>
-#include <libnautilus-private/nautilus-directory-background.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-dnd.h>
#include <libnautilus-private/nautilus-file-utilities.h>
@@ -1414,14 +1412,6 @@ fm_icon_view_can_zoom_out (FMDirectoryView *view)
> NAUTILUS_ZOOM_LEVEL_SMALLEST;
}
-static GtkWidget *
-fm_icon_view_get_background_widget (FMDirectoryView *view)
-{
- g_return_val_if_fail (FM_IS_ICON_VIEW (view), NULL);
-
- return GTK_WIDGET (get_icon_container (FM_ICON_VIEW (view)));
-}
-
static gboolean
fm_icon_view_is_empty (FMDirectoryView *view)
{
@@ -1876,6 +1866,14 @@ fm_icon_view_using_manual_layout (FMDirectoryView *view)
}
static void
+fm_icon_view_set_is_active (FMDirectoryView *view,
+ gboolean is_active)
+{
+ nautilus_icon_container_set_active (get_icon_container (FM_ICON_VIEW (view)),
+ is_active);
+}
+
+static void
fm_icon_view_widget_to_file_operation_position (FMDirectoryView *view,
GdkPoint *position)
{
@@ -2945,7 +2943,6 @@ fm_icon_view_class_init (FMIconViewClass *klass)
fm_directory_view_class->clear = fm_icon_view_clear;
fm_directory_view_class->end_loading = fm_icon_view_end_loading;
fm_directory_view_class->file_changed = fm_icon_view_file_changed;
- fm_directory_view_class->get_background_widget = fm_icon_view_get_background_widget;
fm_directory_view_class->get_selected_icon_locations = fm_icon_view_get_selected_icon_locations;
fm_directory_view_class->get_selection = fm_icon_view_get_selection;
fm_directory_view_class->get_selection_for_file_transfer = fm_icon_view_get_selection;
@@ -2956,6 +2953,7 @@ fm_icon_view_class_init (FMIconViewClass *klass)
fm_directory_view_class->restore_default_zoom_level = fm_icon_view_restore_default_zoom_level;
fm_directory_view_class->reveal_selection = fm_icon_view_reveal_selection;
fm_directory_view_class->select_all = fm_icon_view_select_all;
+ fm_directory_view_class->set_is_active = fm_icon_view_set_is_active;
fm_directory_view_class->set_selection = fm_icon_view_set_selection;
fm_directory_view_class->invert_selection = fm_icon_view_invert_selection;
fm_directory_view_class->compare_files = compare_files;
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 68b7d93..1000280 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1945,12 +1945,6 @@ fm_list_view_file_changed (FMDirectoryView *view, NautilusFile *file, NautilusDi
}
}
-static GtkWidget *
-fm_list_view_get_background_widget (FMDirectoryView *view)
-{
- return GTK_WIDGET (view);
-}
-
static void
fm_list_view_get_selection_foreach_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
{
@@ -3005,22 +2999,20 @@ static void
real_set_is_active (FMDirectoryView *view,
gboolean is_active)
{
- GtkWidget *tree_view;
- GtkStyle *style;
+ GtkWidget *widget;
GdkColor color;
+ GtkStyle *style;
- tree_view = GTK_WIDGET (fm_list_view_get_tree_view (FM_LIST_VIEW (view)));
+ widget = GTK_WIDGET (fm_list_view_get_tree_view (FM_LIST_VIEW (view)));
+ style = gtk_widget_get_style (widget);
- if (is_active) {
- gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, NULL);
+ if (!is_active) {
+ color = style->base[GTK_STATE_NORMAL];
+ eel_make_color_inactive (&color);
+ gtk_widget_modify_base (widget, GTK_STATE_NORMAL, &color);
} else {
- style = gtk_widget_get_style (tree_view);
- color = style->base[GTK_STATE_INSENSITIVE];
- gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, &color);
+ gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL);
}
-
- EEL_CALL_PARENT (FM_DIRECTORY_VIEW_CLASS,
- set_is_active, (view, is_active));
}
static void
@@ -3042,7 +3034,6 @@ fm_list_view_class_init (FMListViewClass *class)
fm_directory_view_class->click_policy_changed = fm_list_view_click_policy_changed;
fm_directory_view_class->clear = fm_list_view_clear;
fm_directory_view_class->file_changed = fm_list_view_file_changed;
- fm_directory_view_class->get_background_widget = fm_list_view_get_background_widget;
fm_directory_view_class->get_selection = fm_list_view_get_selection;
fm_directory_view_class->get_selection_for_file_transfer = fm_list_view_get_selection_for_file_transfer;
fm_directory_view_class->get_item_count = fm_list_view_get_item_count;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]