[gtk+/pathbar] Reorder the toplevel declarations a bit
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/pathbar] Reorder the toplevel declarations a bit
- Date: Mon, 29 Apr 2013 23:02:52 +0000 (UTC)
commit dfb71eadd5b4a86752e70734c6a51c206ff80dee
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Apr 29 17:27:44 2013 -0500
Reorder the toplevel declarations a bit
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkpathbar.c | 54 +++++++++++++++++++++++++++++++-----------------------
1 files changed, 31 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 6e1983b..8d539c1 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -38,6 +38,33 @@
#include "gtkwidgetpath.h"
#include "gtkwidgetprivate.h"
+typedef enum {
+ NORMAL_BUTTON,
+ ROOT_BUTTON,
+ HOME_BUTTON,
+ DESKTOP_BUTTON,
+ MOUNT_BUTTON
+} ButtonType;
+
+#define BUTTON_DATA(x) ((ButtonData *)(x))
+
+typedef struct
+{
+ GtkWidget *button;
+ ButtonType type;
+ char *dir_name;
+ GFile *file;
+
+ GtkWidget *image;
+ GtkWidget *label;
+ GtkWidget *bold_label;
+
+ GCancellable *cancellable;
+ guint ignore_changes : 1;
+ guint file_is_hidden : 1;
+ guint is_root : 1;
+} ButtonData;
+
struct _GtkPathBarPrivate
{
GtkPlacesOpenFlags open_flags;
@@ -48,6 +75,8 @@ struct _GtkPathBarPrivate
GFile *home_file;
GFile *desktop_file;
+ ButtonData *current_button_data;
+
GCancellable *get_info_cancellable;
GdkPixbuf *root_icon;
@@ -65,7 +94,6 @@ struct _GtkPathBarPrivate
gint icon_size;
gint16 slider_width;
gint16 spacing;
- gint16 button_offset;
guint timer;
guint slider_visible : 1;
guint need_timer : 1;
@@ -85,15 +113,6 @@ enum {
NUM_PROPERTIES
};
-typedef enum {
- NORMAL_BUTTON,
- ROOT_BUTTON,
- HOME_BUTTON,
- DESKTOP_BUTTON
-} ButtonType;
-
-#define BUTTON_DATA(x) ((ButtonData *)(x))
-
#define SCROLL_DELAY_FACTOR 5
static guint path_bar_signals [LAST_SIGNAL] = { 0 };
@@ -103,20 +122,9 @@ static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
/* Icon size for if we can't get it from the theme */
#define FALLBACK_ICON_SIZE 16
-typedef struct _ButtonData ButtonData;
+/* Avoid overly long buttons (FIXME: shouldn't this be based on the font size?) */
+#define BUTTON_MAX_WIDTH 250
-struct _ButtonData
-{
- GtkWidget *button;
- ButtonType type;
- char *dir_name;
- GFile *file;
- GtkWidget *image;
- GtkWidget *label;
- GCancellable *cancellable;
- guint ignore_changes : 1;
- guint file_is_hidden : 1;
-};
/* This macro is used to check if a button can be used as a fake root.
* All buttons in front of a fake root are automatically hidden when in a
* directory below a fake root and replaced with the "<" arrow button.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]