Compare commits
3 Commits
8fdf9e2bc3
...
59af3b7e7b
Author | SHA1 | Date | |
---|---|---|---|
59af3b7e7b | |||
fc559c3d01 | |||
6869816cc4 |
@ -53,16 +53,29 @@ fiv_sidebar_dispose(GObject *gobject)
|
||||
G_OBJECT_CLASS(fiv_sidebar_parent_class)->dispose(gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
fiv_sidebar_realize(GtkWidget *widget)
|
||||
{
|
||||
GTK_WIDGET_CLASS(fiv_sidebar_parent_class)->realize(widget);
|
||||
|
||||
// Fucking GTK+. With no bookmarks, the revealer takes up space anyway.
|
||||
FivSidebar *self = FIV_SIDEBAR(widget);
|
||||
gtk_places_sidebar_set_drop_targets_visible(self->places, TRUE, NULL);
|
||||
gtk_places_sidebar_set_drop_targets_visible(self->places, FALSE, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
fiv_sidebar_class_init(FivSidebarClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
object_class->dispose = fiv_sidebar_dispose;
|
||||
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
|
||||
widget_class->realize = fiv_sidebar_realize;
|
||||
|
||||
// You're giving me no choice, Adwaita.
|
||||
// Your style is hardcoded to match against the class' CSS name.
|
||||
// And I need replicate the internal widget structure.
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
|
||||
gtk_widget_class_set_css_name(widget_class, "placessidebar");
|
||||
|
||||
// TODO(p): Consider a return value, and using it.
|
||||
@ -120,6 +133,20 @@ on_breadcrumb_drag_data_get(G_GNUC_UNUSED GtkWidget *widget,
|
||||
g_free(*uris);
|
||||
}
|
||||
|
||||
static void
|
||||
on_breadcrumb_drag_begin(G_GNUC_UNUSED GtkWidget *widget,
|
||||
GdkDragContext *context, gpointer user_data)
|
||||
{
|
||||
gtk_places_sidebar_set_drop_targets_visible(user_data, TRUE, context);
|
||||
}
|
||||
|
||||
static void
|
||||
on_breadcrumb_drag_end(G_GNUC_UNUSED GtkWidget *widget,
|
||||
GdkDragContext *context, gpointer user_data)
|
||||
{
|
||||
gtk_places_sidebar_set_drop_targets_visible(user_data, FALSE, context);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_row(FivSidebar *self, GFile *file, const char *icon_name)
|
||||
{
|
||||
@ -178,6 +205,10 @@ create_row(FivSidebar *self, GFile *file, const char *icon_name)
|
||||
G_CALLBACK(on_breadcrumb_release), row);
|
||||
g_signal_connect(revealer, "drag-data-get",
|
||||
G_CALLBACK(on_breadcrumb_drag_data_get), row);
|
||||
g_signal_connect(revealer, "drag-begin",
|
||||
G_CALLBACK(on_breadcrumb_drag_begin), self->places);
|
||||
g_signal_connect(revealer, "drag-end",
|
||||
G_CALLBACK(on_breadcrumb_drag_end), self->places);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(row), revealer);
|
||||
gtk_widget_show_all(row);
|
||||
|
@ -83,7 +83,7 @@ if gdkpixbuf.found()
|
||||
dependencies : [dependencies, gdkpixbuf])
|
||||
endif
|
||||
|
||||
# XXX: With gdk-pixbuf, this even dependens on currently installed modules.
|
||||
# XXX: With gdk-pixbuf, this even depends on currently installed modules.
|
||||
if meson.is_cross_build()
|
||||
install_data('fiv.desktop',
|
||||
install_dir : get_option('datadir') + '/applications')
|
||||
@ -93,7 +93,7 @@ else
|
||||
output : 'fiv.desktop',
|
||||
input : 'fiv.desktop',
|
||||
command : ['sh', '-c', '''awk '/^MimeType=/ { $0 = "MimeType=";
|
||||
while ((exe " --list-supported-media-types" | getline type) > 0)
|
||||
while (((exe " --list-supported-media-types") | getline type) > 0)
|
||||
$0 = $0 type ";" } 1' "exe=$1" "$2"''', 'sh', exe, '@INPUT@'],
|
||||
capture : true,
|
||||
install : true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user