diff options
author | Carlos Soriano <carlos.soriano89@gmail.com> | 2014-09-23 15:52:37 +0200 |
---|---|---|
committer | Carlos Soriano <carlos.soriano89@gmail.com> | 2014-09-23 17:53:08 +0200 |
commit | 1f7cbec71f908e315a71acb752e10a36049a4ad1 (patch) | |
tree | 5e0e614e3407745cbe91367629cfe7651c4248ad /src/nautilus-pathbar-button-label.h | |
parent | f53a160287a50957d0df628651ecbc8353149c40 (diff) | |
download | nautilus-wip/minButWidth.tar.gz |
nautilus-pathbar: Allow label shrinkingwip/minButWidth
Currently the labels of the pathbar set a required size based on its
preferred size. That brings the problem that setting a minimum size of
its preferred size doesn't allow to shrink the label when needed, e.g.
when the windows need to be snapped to a side or when making the window
smaller.
To avoid that, implement a GObject that its preferred size its natural
size, and minimum size of 0, allowing the label to shrink when necesary.
https://bugzilla.gnome.org/show_bug.cgi?id=736792
Diffstat (limited to 'src/nautilus-pathbar-button-label.h')
-rw-r--r-- | src/nautilus-pathbar-button-label.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/nautilus-pathbar-button-label.h b/src/nautilus-pathbar-button-label.h new file mode 100644 index 000000000..4a5f65784 --- /dev/null +++ b/src/nautilus-pathbar-button-label.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* nautilus-pathbar-button-label.h + * + * Copyright (C) 2014 Carlos Soriano <carlos.soriano89@gmail.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + * + * Authors Carlos Soriano <carlos.soriano89@gmail.com> + */ + +#ifndef NAUTILUS_PATHBAR_BUTTON_LABEL_H +#define NAUTILUS_PATHBAR_BUTTON_LABEL_H + +#include <glib-object.h> +#include <gtk/gtk.h> +#include <gio/gio.h> + +G_BEGIN_DECLS + +#define NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL (nautilus_pathbar_button_label_get_type()) +#define NAUTILUS_PATHBAR_BUTTON_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL, NautilusPathbarButtonLabel)) +#define NAUTILUS_PATHBAR_BUTTON_LABEL_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL, NautilusPathbarButtonLabel const)) +#define NAUTILUS_PATHBAR_BUTTON_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL, NautilusPathbarButtonLabelClass)) +#define NAUTILUS_IS_PATHBAR_BUTTON_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL)) +#define NAUTILUS_IS_PATHBAR_BUTTON_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL)) +#define NAUTILUS_PATHBAR_BUTTON_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_PATHBAR_BUTTON_LABEL, NautilusPathbarButtonLabelClass)) + +typedef struct _NautilusPathbarButtonLabel NautilusPathbarButtonLabel; +typedef struct _NautilusPathbarButtonLabelClass NautilusPathbarButtonLabelClass; +typedef struct _NautilusPathbarButtonLabelPrivate NautilusPathbarButtonLabelPrivate; + +struct _NautilusPathbarButtonLabel +{ + GtkBox parent; + + /*< private >*/ + NautilusPathbarButtonLabelPrivate *priv; +}; + +struct _NautilusPathbarButtonLabelClass +{ + GtkBoxClass parent; +}; + +GType nautilus_pathbar_button_label_get_type (void) G_GNUC_CONST; +NautilusPathbarButtonLabel *nautilus_pathbar_button_label_new (void); + +void nautilus_pathbar_button_label_set_text(NautilusPathbarButtonLabel *self, + gchar *dir_name); +void nautilus_pathbar_button_label_set_bold(NautilusPathbarButtonLabel *self, + gboolean *bold); + +G_END_DECLS + +#endif /* NAUTILUS_PATHBAR_BUTTON_LABEL_H */ |