Add shumate-1-0 and testing ShumateSimpleMap.

master
Zwarf 2022-01-24 16:49:51 +01:00
rodzic 8ee40501dd
commit a964a8de6a
5 zmienionych plików z 37 dodań i 8 usunięć

Wyświetl plik

@ -15,7 +15,7 @@ picplanner_sources = [
picplanner_deps = [
dependency('gtk4'),
dependency('shumate-0.0'),
dependency('shumate-1.0'),
meson.get_compiler('c').find_library('m', required: false),
]

Wyświetl plik

@ -19,6 +19,7 @@
#pragma once
#include <gtk/gtk.h>
#include <shumate/shumate.h>
#include "picplanner-config.h"
#include "picplanner-application.h"

Wyświetl plik

@ -7,6 +7,8 @@ struct _PicplannerOverview
GtkWidget *calendar;
GtkWidget *calendar_popover;
GtkWidget *calendar_button;
GtkWidget *north_entry;
GtkWidget *east_entry;
};
@ -14,12 +16,23 @@ G_DEFINE_TYPE (PicplannerOverview, picplanner_overview, GTK_TYPE_BOX)
static void
coordinate_entry_changed (GtkWidget *self,
gpointer user_data)
PicplannerOverview *overview)
{
(void) self;
(void) user_data;
GtkEntryBuffer *north_buffer;
GtkEntryBuffer *east_buffer;
const gchar *north;
const gchar *east;
g_print ("Coordinates changed...\n");
north_buffer = gtk_entry_get_buffer (GTK_ENTRY (overview->north_entry));
east_buffer = gtk_entry_get_buffer (GTK_ENTRY (overview->east_entry));
north = gtk_entry_buffer_get_text (north_buffer);
east = gtk_entry_buffer_get_text (east_buffer);
g_print ("Coordinates changed to: N %f, E %f \n", atof(north), atof(east));
}
@ -74,12 +87,16 @@ picplanner_overview_init (PicplannerOverview *self)
static void
picplanner_overview_class_init (PicplannerOverviewClass *class)
{
g_type_ensure (SHUMATE_TYPE_SIMPLE_MAP);
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
"/de/zwarf/picplanner/ui/overview-view.ui");
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, calendar);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, calendar_popover);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, calendar_button);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, north_entry);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, east_entry);
gtk_widget_class_bind_template_callback (class, coordinate_entry_changed);
gtk_widget_class_bind_template_callback (class, time_changed);

Wyświetl plik

@ -1,4 +1,5 @@
#include <gtk/gtk.h>
#include <shumate/shumate.h>
#include "picplanner-window.h"
#include "picplanner-application.h"

Wyświetl plik

@ -79,9 +79,10 @@
</object>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="north_entry">
<property name="halign">start</property>
<property name="margin-end">15</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="coordinate_entry_changed"/>
</object>
</child>
@ -94,7 +95,7 @@
</object>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="east_entry">
<property name="halign">end</property>
<property name="hexpand">false</property>
<signal name="changed" handler="coordinate_entry_changed"/>
@ -159,13 +160,22 @@
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<child>
<object class="ShumateSimpleMap" id="map">
</object>
</child>
</object>
</child>
</object>
</child>