summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2020-07-31 16:10:56 +0500
committerAlexander Mikhaylenko <alexm@gnome.org>2020-08-01 14:37:20 +0500
commit5e136b9f9cfeca2d67a76086cadbbbd675d07ef4 (patch)
treeb044a8108abe88145d9cb9c434261cf0813cd743 /src
parentf5009d099da6f92b5aa292ba80f495ee824c5783 (diff)
downloadgnome-screenshot-5e136b9f9cfeca2d67a76086cadbbbd675d07ef4.tar.gz
interactive-dialog: Port to libhandy
Diffstat (limited to 'src')
-rw-r--r--src/screenshot-interactive-dialog.c31
-rw-r--r--src/screenshot-interactive-dialog.h5
2 files changed, 5 insertions, 31 deletions
diff --git a/src/screenshot-interactive-dialog.c b/src/screenshot-interactive-dialog.c
index ab866b3..a7b15ba 100644
--- a/src/screenshot-interactive-dialog.c
+++ b/src/screenshot-interactive-dialog.c
@@ -36,7 +36,7 @@ typedef enum {
struct _ScreenshotInteractiveDialog
{
- GtkApplicationWindow parent_instance;
+ HdyApplicationWindow parent_instance;
GtkWidget *listbox;
GtkWidget *pointer;
@@ -46,7 +46,7 @@ struct _ScreenshotInteractiveDialog
GtkWidget *selection;
};
-G_DEFINE_TYPE (ScreenshotInteractiveDialog, screenshot_interactive_dialog, GTK_TYPE_APPLICATION_WINDOW)
+G_DEFINE_TYPE (ScreenshotInteractiveDialog, screenshot_interactive_dialog, HDY_TYPE_APPLICATION_WINDOW)
enum {
SIGNAL_CAPTURE,
@@ -115,28 +115,6 @@ capture_button_clicked_cb (GtkButton *button,
}
static void
-header_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- ScreenshotInteractiveDialog *self)
-{
- GtkWidget *current;
-
- if (before == NULL)
- {
- gtk_list_box_row_set_header (row, NULL);
- return;
- }
-
- current = gtk_list_box_row_get_header (row);
- if (current == NULL)
- {
- current = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_widget_show (current);
- gtk_list_box_row_set_header (row, current);
- }
-}
-
-static void
screenshot_interactive_dialog_class_init (ScreenshotInteractiveDialogClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@@ -171,11 +149,6 @@ screenshot_interactive_dialog_init (ScreenshotInteractiveDialog *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_list_box_set_header_func (GTK_LIST_BOX (self->listbox),
- (GtkListBoxUpdateHeaderFunc) header_func,
- self,
- NULL);
-
if (screenshot_config->take_window_shot)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->window), TRUE);
diff --git a/src/screenshot-interactive-dialog.h b/src/screenshot-interactive-dialog.h
index cd98c1d..e506b66 100644
--- a/src/screenshot-interactive-dialog.h
+++ b/src/screenshot-interactive-dialog.h
@@ -22,13 +22,14 @@
#pragma once
-#include <gtk/gtk.h>
+#define HANDY_USE_UNSTABLE_API
+#include <handy.h>
G_BEGIN_DECLS
#define SCREENSHOT_TYPE_INTERACTIVE_DIALOG (screenshot_interactive_dialog_get_type())
-G_DECLARE_FINAL_TYPE (ScreenshotInteractiveDialog, screenshot_interactive_dialog, SCREENSHOT, INTERACTIVE_DIALOG, GtkApplicationWindow)
+G_DECLARE_FINAL_TYPE (ScreenshotInteractiveDialog, screenshot_interactive_dialog, SCREENSHOT, INTERACTIVE_DIALOG, HdyApplicationWindow)
ScreenshotInteractiveDialog *screenshot_interactive_dialog_new (GtkApplication *app);