Commit c8d66512 authored by Alessandro Bono's avatar Alessandro Bono Committed by Debarshi Ray

base-model, dropdown: Port to GMenuModel

Now that we have GActions for search options, tie it all together and
use them to build the popover contents. We have to steal the child of a
GtkPopover to get the UI, since GTK doesn't expose a public API for
that yet.

https://bugzilla.gnome.org/show_bug.cgi?id=726462
parent 590c0055
......@@ -74,8 +74,6 @@ gnome_photos_SOURCES = \
photos-base-model.h \
photos-base-item.c \
photos-base-item.h \
photos-base-view.c \
photos-base-view.h \
photos-camera-cache.c \
photos-camera-cache.h \
photos-collection-icon-watcher.c \
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2015 Alessandro Bono
* Copyright © 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
......@@ -28,10 +29,12 @@
#include <glib.h>
#include "photos-base-model.h"
#include "photos-filterable.h"
struct _PhotosBaseModelPrivate
{
GMenu *model;
PhotosBaseManager *mngr;
};
......@@ -42,7 +45,34 @@ enum
};
G_DEFINE_TYPE_WITH_PRIVATE (PhotosBaseModel, photos_base_model, GTK_TYPE_LIST_STORE);
G_DEFINE_TYPE_WITH_PRIVATE (PhotosBaseModel, photos_base_model, G_TYPE_OBJECT);
static void
photos_base_model_action_state_changed (PhotosBaseModel *self, const gchar *action_name, GVariant *value)
{
const gchar *id;
id = g_variant_get_string (value, NULL);
photos_base_manager_set_active_object_by_id (self->priv->mngr, id);
}
static void
photos_base_model_active_changed (PhotosBaseModel *self, GObject *active_object)
{
PhotosBaseModelPrivate *priv = self->priv;
GApplication *app;
GVariant *state;
const gchar *action_id;
const gchar *id;
app = g_application_get_default ();
action_id = photos_base_manager_get_action_id (priv->mngr);
id = photos_filterable_get_id (PHOTOS_FILTERABLE (active_object));
state = g_variant_new ("s", id);
g_action_group_change_action_state (G_ACTION_GROUP (app), action_id, state);
}
static void
......@@ -51,43 +81,40 @@ photos_base_model_refresh (PhotosBaseModel *self)
PhotosBaseModelPrivate *priv = self->priv;
GHashTable *objects;
GHashTableIter hash_iter;
GMenu *section;
GObject *object;
GtkTreeIter model_iter;
const gchar *action_id;
const gchar *id;
const gchar *title;
gtk_list_store_clear (GTK_LIST_STORE (self));
g_menu_remove_all (priv->model);
title = photos_base_manager_get_title (priv->mngr);
if (title != NULL)
{
gtk_list_store_append (GTK_LIST_STORE (self), &model_iter);
gtk_list_store_set (GTK_LIST_STORE (self),
&model_iter,
PHOTOS_BASE_MODEL_ID, "heading",
PHOTOS_BASE_MODEL_NAME, "",
PHOTOS_BASE_MODEL_HEADING_TEXT, title,
-1);
}
action_id = photos_base_manager_get_action_id (priv->mngr);
section = g_menu_new ();
g_menu_append_section (priv->model, title, G_MENU_MODEL (section));
objects = photos_base_manager_get_objects (priv->mngr);
g_hash_table_iter_init (&hash_iter, objects);
while (g_hash_table_iter_next (&hash_iter, (gpointer *) &id, (gpointer *) &object))
{
GMenuItem *menu_item;
GVariant *target_value;
gchar *name;
gtk_list_store_append (GTK_LIST_STORE (self), &model_iter);
g_object_get (object, "name", &name, NULL);
gtk_list_store_set (GTK_LIST_STORE (self),
&model_iter,
PHOTOS_BASE_MODEL_ID, id,
PHOTOS_BASE_MODEL_NAME, name,
PHOTOS_BASE_MODEL_HEADING_TEXT, "",
-1);
menu_item = g_menu_item_new (name, NULL);
target_value = g_variant_new ("s", id);
g_menu_item_set_action_and_target_value (menu_item, action_id, target_value);
g_menu_append_item (section, menu_item);
g_free (name);
}
g_object_unref (section);
}
......@@ -96,9 +123,14 @@ photos_base_model_constructed (GObject *object)
{
PhotosBaseModel *self = PHOTOS_BASE_MODEL (object);
PhotosBaseModelPrivate *priv = self->priv;
GApplication *app;
const gchar *action_id;
gchar *detailed_signal;
G_OBJECT_CLASS (photos_base_model_parent_class)->constructed (object);
priv->model = g_menu_new ();
g_signal_connect_object (priv->mngr,
"object-added",
G_CALLBACK (photos_base_model_refresh),
......@@ -110,6 +142,22 @@ photos_base_model_constructed (GObject *object)
self,
G_CONNECT_SWAPPED);
app = g_application_get_default ();
action_id = photos_base_manager_get_action_id (priv->mngr);
detailed_signal = g_strconcat ("action-state-changed::", action_id, NULL);
g_signal_connect_object (app,
detailed_signal,
G_CALLBACK (photos_base_model_action_state_changed),
self,
G_CONNECT_SWAPPED);
g_free (detailed_signal);
g_signal_connect_object (priv->mngr,
"active-changed",
G_CALLBACK (photos_base_model_active_changed),
self,
G_CONNECT_SWAPPED);
photos_base_model_refresh (self);
}
......@@ -118,8 +166,10 @@ static void
photos_base_model_dispose (GObject *object)
{
PhotosBaseModel *self = PHOTOS_BASE_MODEL (object);
PhotosBaseModelPrivate *priv = self->priv;
g_clear_object (&self->priv->mngr);
g_clear_object (&priv->model);
g_clear_object (&priv->mngr);
G_OBJECT_CLASS (photos_base_model_parent_class)->dispose (object);
}
......@@ -146,13 +196,7 @@ photos_base_model_set_property (GObject *object, guint prop_id, const GValue *va
static void
photos_base_model_init (PhotosBaseModel *self)
{
GType columns[] = {G_TYPE_STRING, /* ID */
G_TYPE_STRING, /* NAME */
G_TYPE_STRING}; /* HEADING TEXT */
self->priv = photos_base_model_get_instance_private (self);
gtk_list_store_set_column_types (GTK_LIST_STORE (self), sizeof (columns) / sizeof (columns[0]), columns);
}
......@@ -175,8 +219,15 @@ photos_base_model_class_init (PhotosBaseModelClass *class)
}
GtkListStore *
PhotosBaseModel *
photos_base_model_new (PhotosBaseManager *mngr)
{
return g_object_new (PHOTOS_TYPE_BASE_MODEL, "manager", mngr, NULL);
}
GMenu *
photos_base_model_get_model (PhotosBaseModel *self)
{
return self->priv->model;
}
......@@ -25,7 +25,7 @@
#ifndef PHOTOS_BASE_MODEL_H
#define PHOTOS_BASE_MODEL_H
#include <gtk/gtk.h>
#include <gio/gio.h>
#include "photos-base-manager.h"
......@@ -53,31 +53,26 @@ G_BEGIN_DECLS
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
PHOTOS_TYPE_BASE_MODEL, PhotosBaseModelClass))
typedef enum
{
PHOTOS_BASE_MODEL_ID,
PHOTOS_BASE_MODEL_NAME,
PHOTOS_BASE_MODEL_HEADING_TEXT
} PhotosBaseModelColumns;
typedef struct _PhotosBaseModel PhotosBaseModel;
typedef struct _PhotosBaseModelClass PhotosBaseModelClass;
typedef struct _PhotosBaseModelPrivate PhotosBaseModelPrivate;
struct _PhotosBaseModel
{
GtkListStore parent_instance;
GObject parent_instance;
PhotosBaseModelPrivate *priv;
};
struct _PhotosBaseModelClass
{
GtkListStoreClass parent_class;
GObjectClass parent_class;
};
GType photos_base_model_get_type (void) G_GNUC_CONST;
GtkListStore *photos_base_model_new (PhotosBaseManager *mngr);
PhotosBaseModel *photos_base_model_new (PhotosBaseManager *mngr);
GMenu *photos_base_model_get_model (PhotosBaseModel *self);
G_END_DECLS
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/* Based on code from:
* + Documents
*/
#include "config.h"
#include "photos-base-view.h"
#include "photos-base-model.h"
#include "photos-filterable.h"
struct _PhotosBaseViewPrivate
{
GtkCellRenderer *renderer_heading;
GtkCellRenderer *renderer_radio;
GtkCellRenderer *renderer_text;
GtkListStore *model;
PhotosBaseManager *mngr;
};
enum
{
PROP_0,
PROP_MANAGER
};
G_DEFINE_TYPE_WITH_PRIVATE (PhotosBaseView, photos_base_view, GTK_TYPE_TREE_VIEW);
typedef void (*PhotosBaseViewRendererCellFunc) (PhotosBaseView *,
GtkTreeViewColumn *,
GtkCellRenderer *,
GtkTreeIter *);
static void
photos_base_view_visibility_for_heading (PhotosBaseView *self,
GtkTreeViewColumn *col,
GtkCellRenderer *cell,
GtkTreeIter *iter,
gboolean visible,
PhotosBaseViewRendererCellFunc additional_func)
{
gboolean cell_visible;
gchar *heading;
gtk_tree_model_get (GTK_TREE_MODEL (self->priv->model), iter, PHOTOS_BASE_MODEL_HEADING_TEXT, &heading, -1);
cell_visible = (visible && heading != NULL && heading[0] != '\0')
|| (!visible && heading != NULL && heading[0] == '\0');
gtk_cell_renderer_set_visible (cell, cell_visible);
g_free (heading);
if (additional_func != NULL)
(*additional_func) (self, col, cell, iter);
}
static void
photos_base_view_renderer_heading_cell_data (GtkTreeViewColumn *col,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer user_data)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (user_data);
photos_base_view_visibility_for_heading (self, col, cell, iter, TRUE, NULL);
}
static void
photos_base_view_renderer_radio_cell_func (PhotosBaseView *self,
GtkTreeViewColumn *col,
GtkCellRenderer *cell,
GtkTreeIter *iter)
{
PhotosBaseViewPrivate *priv = self->priv;
GObject *object;
gboolean active;
const gchar *active_id = NULL;
gchar *id;
gtk_tree_model_get (GTK_TREE_MODEL (priv->model), iter, PHOTOS_BASE_MODEL_ID, &id, -1);
object = photos_base_manager_get_active_object (priv->mngr);
if (object != NULL)
active_id = photos_filterable_get_id (PHOTOS_FILTERABLE (object));
active = g_strcmp0 (id, active_id) == 0;
gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cell), active);
g_free (id);
}
static void
photos_base_view_renderer_radio_cell_data (GtkTreeViewColumn *col,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer user_data)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (user_data);
photos_base_view_visibility_for_heading (self, col, cell, iter, FALSE, photos_base_view_renderer_radio_cell_func);
}
static void
photos_base_view_renderer_text_cell_data (GtkTreeViewColumn *col,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer user_data)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (user_data);
photos_base_view_visibility_for_heading (self, col, cell, iter, FALSE, NULL);
}
static void
photos_base_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (tree_view);
PhotosBaseViewPrivate *priv = self->priv;
GtkTreeIter iter;
gchar *id;
gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, PHOTOS_BASE_MODEL_ID, &id, -1);
photos_base_manager_set_active_object_by_id (priv->mngr, id);
g_free (id);
}
static void
photos_base_view_constructed (GObject *object)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (object);
PhotosBaseViewPrivate *priv = self->priv;
GtkTreeSelection *selection;
GtkTreeViewColumn *col;
G_OBJECT_CLASS (photos_base_view_parent_class)->constructed (object);
priv->model = photos_base_model_new (priv->mngr);
gtk_tree_view_set_model (GTK_TREE_VIEW (self), GTK_TREE_MODEL (priv->model));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
g_signal_connect (self, "row-activated", G_CALLBACK (photos_base_view_row_activated), NULL);
col = gtk_tree_view_column_new ();
gtk_tree_view_append_column (GTK_TREE_VIEW (self), col);
priv->renderer_heading = gtk_cell_renderer_text_new ();
g_object_set (priv->renderer_heading, "weight", PANGO_WEIGHT_BOLD, "weight-set", TRUE, NULL);
gtk_tree_view_column_pack_start (col, priv->renderer_heading, FALSE);
gtk_tree_view_column_add_attribute (col, priv->renderer_heading, "text", PHOTOS_BASE_MODEL_HEADING_TEXT);
gtk_tree_view_column_set_cell_data_func (col,
priv->renderer_heading,
photos_base_view_renderer_heading_cell_data,
self,
NULL);
priv->renderer_radio = gtk_cell_renderer_toggle_new ();
gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (priv->renderer_radio), TRUE);
g_object_set (priv->renderer_radio, "mode", GTK_CELL_RENDERER_MODE_INERT, NULL);
gtk_tree_view_column_pack_start (col, priv->renderer_radio, FALSE);
gtk_tree_view_column_set_cell_data_func (col,
priv->renderer_radio,
photos_base_view_renderer_radio_cell_data,
self,
NULL);
priv->renderer_text = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (col, priv->renderer_text, TRUE);
gtk_tree_view_column_add_attribute (col, priv->renderer_text, "text", PHOTOS_BASE_MODEL_NAME);
gtk_tree_view_column_set_cell_data_func (col,
priv->renderer_text,
photos_base_view_renderer_text_cell_data,
self,
NULL);
gtk_widget_show_all (GTK_WIDGET (self));
}
static void
photos_base_view_dispose (GObject *object)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (object);
PhotosBaseViewPrivate *priv = self->priv;
g_clear_object (&priv->model);
g_clear_object (&priv->mngr);
G_OBJECT_CLASS (photos_base_view_parent_class)->dispose (object);
}
static void
photos_base_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
PhotosBaseView *self = PHOTOS_BASE_VIEW (object);
switch (prop_id)
{
case PROP_MANAGER:
self->priv->mngr = PHOTOS_BASE_MANAGER (g_value_dup_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
photos_base_view_init (PhotosBaseView *self)
{
self->priv = photos_base_view_get_instance_private (self);
}
static void
photos_base_view_class_init (PhotosBaseViewClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->constructed = photos_base_view_constructed;
object_class->dispose = photos_base_view_dispose;
object_class->set_property = photos_base_view_set_property;
g_object_class_install_property (object_class,
PROP_MANAGER,
g_param_spec_object ("manager",
"PhotosBaseManager object",
"The manager whose data is being rendered by this view",
PHOTOS_TYPE_BASE_MANAGER,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
}
GtkWidget *
photos_base_view_new (PhotosBaseManager *mngr)
{
return g_object_new (PHOTOS_TYPE_BASE_VIEW,
"activate-on-single-click", TRUE,
"enable-search", FALSE,
"headers-visible", FALSE,
"manager", mngr,
NULL);
}
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/* Based on code from:
* + Documents
*/
#ifndef PHOTOS_BASE_VIEW_H
#define PHOTOS_BASE_VIEW_H
#include <gtk/gtk.h>
#include "photos-base-manager.h"
G_BEGIN_DECLS
#define PHOTOS_TYPE_BASE_VIEW (photos_base_view_get_type ())
#define PHOTOS_BASE_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
PHOTOS_TYPE_BASE_VIEW, PhotosBaseView))
#define PHOTOS_BASE_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
PHOTOS_TYPE_BASE_VIEW, PhotosBaseViewClass))
#define PHOTOS_IS_BASE_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
PHOTOS_TYPE_BASE_VIEW))
#define PHOTOS_IS_BASE_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
PHOTOS_TYPE_BASE_VIEW))
#define PHOTOS_BASE_VIEW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
PHOTOS_TYPE_BASE_VIEW, PhotosBaseViewClass))
typedef struct _PhotosBaseView PhotosBaseView;
typedef struct _PhotosBaseViewClass PhotosBaseViewClass;
typedef struct _PhotosBaseViewPrivate PhotosBaseViewPrivate;
struct _PhotosBaseView
{
GtkTreeView parent_instance;
PhotosBaseViewPrivate *priv;
};
struct _PhotosBaseViewClass
{
GtkTreeViewClass parent_class;
};
GType photos_base_view_get_type (void) G_GNUC_CONST;
GtkWidget *photos_base_view_new (PhotosBaseManager *mngr);
G_END_DECLS
#endif /* PHOTOS_BASE_VIEW_H */
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2015 Alessandro Bono
* Copyright © 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
......@@ -26,14 +27,17 @@
#include "config.h"
#include <gio/gio.h>
#include <glib.h>
#include "photos-base-view.h"
#include "photos-base-manager.h"
#include "photos-base-model.h"
#include "photos-dropdown.h"
#include "photos-search-context.h"
struct _PhotosDropdownPrivate
{
GList *models;
GtkWidget *grid;
GtkWidget *match_view;
GtkWidget *source_view;
......@@ -47,6 +51,34 @@ struct _PhotosDropdownPrivate
G_DEFINE_TYPE_WITH_PRIVATE (PhotosDropdown, photos_dropdown, GTK_TYPE_POPOVER);
static void
photos_dropdown_add_manager (PhotosDropdown *self, PhotosBaseManager *mngr)
{
PhotosDropdownPrivate *priv = self->priv;
GMenu *menu;
GtkWidget *popover;
GtkWidget *w;
PhotosBaseModel *model;
model = photos_base_model_new (mngr);
priv->models = g_list_prepend (priv->models, g_object_ref (model));
/* HACK: see https://bugzilla.gnome.org/show_bug.cgi?id=733977 */
popover = gtk_popover_new (NULL);
menu = photos_base_model_get_model (model);
gtk_popover_bind_model (GTK_POPOVER (popover), G_MENU_MODEL (menu), "app");
w = g_object_ref (gtk_bin_get_child (GTK_BIN (popover)));
gtk_container_remove (GTK_CONTAINER (popover), w);
gtk_container_add (GTK_CONTAINER (self->priv->grid), w);
g_object_unref (w);
gtk_widget_set_valign (w, GTK_ALIGN_START);
gtk_widget_set_vexpand (w, TRUE);
gtk_widget_destroy (popover);
g_object_unref (model);
}
static void
photos_dropdown_dispose (GObject *object)
{
......@@ -57,6 +89,9 @@ photos_dropdown_dispose (GObject *object)
g_clear_object (&priv->srch_typ_mngr);
g_clear_object (&priv->src_mngr);
g_list_free_full (priv->models, g_object_unref);
priv->models = NULL;
G_OBJECT_CLASS (photos_dropdown_parent_class)->dispose (object);
}
......@@ -79,22 +114,14 @@ photos_dropdown_init (PhotosDropdown *self)
priv->srch_typ_mngr = g_object_ref (state->srch_typ_mngr);
priv->src_mngr = g_object_ref (state->src_mngr);
priv->match_view = photos_base_view_new (priv->srch_mtch_mngr);
priv->source_view = photos_base_view_new (priv->src_mngr);
priv->type_view = photos_base_view_new (priv->srch_typ_mngr);
priv->grid = gtk_grid_new ();
gtk_widget_set_margin_start (priv->grid, 10);
gtk_widget_set_margin_end (priv->grid, 10);
gtk_widget_set_margin_bottom (priv->grid, 10);
gtk_widget_set_margin_top (priv->grid, 10);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->grid), GTK_ORIENTATION_HORIZONTAL);
gtk_grid_set_row_homogeneous (GTK_GRID (priv->grid), TRUE);
gtk_container_add (GTK_CONTAINER (self), priv->grid);
gtk_container_add (GTK_CONTAINER (priv->grid), priv->source_view);
gtk_container_add (GTK_CONTAINER (priv->grid), priv->type_view);
gtk_container_add (GTK_CONTAINER (priv->grid), priv->match_view);
photos_dropdown_add_manager (self, priv->src_mngr);
photos_dropdown_add_manager (self, priv->srch_typ_mngr);
photos_dropdown_add_manager (self, priv->srch_mtch_mngr);
context = gtk_widget_get_style_context (GTK_WIDGET (self));
gtk_style_context_add_class (context, "photos-dropdown");
......@@ -115,5 +142,5 @@ photos_dropdown_class_init (PhotosDropdownClass *class)
GtkWidget *
photos_dropdown_new (GtkWidget *relative_to)
{
return g_object_new (PHOTOS_TYPE_DROPDOWN, "relative-to", relative_to, "height_request", 240, NULL);
return g_object_new (PHOTOS_TYPE_DROPDOWN, "relative-to", relative_to, "position", GTK_POS_BOTTOM, NULL);
}
......@@ -211,7 +211,7 @@ photos_overview_searchbar_toggled (PhotosOverviewSearchbar *self)
PhotosOverviewSearchbarPrivate *priv = self->priv;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->dropdown_button)))
gtk_widget_show (GTK_WIDGET(priv->dropdown));
gtk_widget_show_all (priv->dropdown);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment