kopia lustrzana https://gitlab.com/Zwarf/picplanner
Merge branch 'main' into 'more_warnings'
# Conflicts: # src/time-picker/time-picker.cmain
commit
64dbb31710
|
@ -24,3 +24,8 @@ Version 0.4.0:
|
|||
- Fullscreen map mode is now saved and not reseted after an app restart
|
||||
- Dependency update
|
||||
- Switch to GNOME 44 runtime
|
||||
|
||||
Version 0.4.1:
|
||||
- Reduced input lag on touch screens significantly
|
||||
- Complet UI redesign for a more compact view
|
||||
- Add French translation
|
||||
|
|
38
copyright
38
copyright
|
@ -1,18 +1,32 @@
|
|||
Files: *
|
||||
Copyright: 2020-2022 Zwarf <zwarf@mail.de>
|
||||
Copyright:
|
||||
2020-2022 Zwarf <zwarf@mail.de>
|
||||
License: GPL-3+
|
||||
|
||||
Files: data/icons/pin.svg
|
||||
data/icons/sun.svg
|
||||
data/icons/moon-full.svg
|
||||
data/icons/moon-waning.svg
|
||||
data/icons/moon-new.svg
|
||||
data/icons/moon-waxing.svg
|
||||
data/icons/milky-way-symbolic.svg
|
||||
data/icons/milky-way-color.svg
|
||||
Copyright: 2022 Rajdeep Singha <rajdeepsingha@proton.me>
|
||||
Files:
|
||||
src/map/draw-layer.*
|
||||
src/map/marker.*
|
||||
Copyright:
|
||||
2008-2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
|
||||
2011-2013 Jiri Techet <techet@gmail.com>
|
||||
2019 Marcus Lundblad <ml@update.uu.se>
|
||||
2021 Zwarf <zwarf@mail.de>
|
||||
License: GPL-3+
|
||||
|
||||
Files: data/icons/map-symbolic.svg
|
||||
Files:
|
||||
data/icons/pin.svg
|
||||
data/icons/sun.svg
|
||||
data/icons/moon-full.svg
|
||||
data/icons/moon-waning.svg
|
||||
data/icons/moon-new.svg
|
||||
data/icons/moon-waxing.svg
|
||||
data/icons/milky-way-symbolic.svg
|
||||
data/icons/milky-way-color.svg
|
||||
Copyright:
|
||||
2022 Rajdeep Singha <rajdeepsingha@proton.me>
|
||||
License: GPL-3+
|
||||
|
||||
Files:
|
||||
data/icons/map-symbolic.svg
|
||||
Copyright: GNOME
|
||||
License: GPL-3+
|
||||
License: GPL-3+
|
||||
|
|
|
@ -62,10 +62,5 @@
|
|||
<summary>Visibility Milky Way</summary>
|
||||
<description>Changes the visibility of the milky ways current position, rise and set on the map.</description>
|
||||
</key>
|
||||
<key name="map-fullscreen" type="b">
|
||||
<default>false</default>
|
||||
<summary>Big map mode</summary>
|
||||
<description>Reduce the amount of information in the Overview tab to enlarge the map.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
|
|
@ -68,11 +68,27 @@
|
|||
<control>touch</control>
|
||||
</supports>
|
||||
|
||||
<recommends>
|
||||
<control>keyboard</control>
|
||||
<control>pointing</control>
|
||||
<control>touch</control>
|
||||
</recommends>
|
||||
|
||||
<requires>
|
||||
<display_length compare="ge">360</display_length>
|
||||
</requires>
|
||||
|
||||
<releases>
|
||||
<release version="0.4.1" date="2023-11-13" >
|
||||
<description>
|
||||
<p>UI redesign, adding French and better touch support</p>
|
||||
<ul>
|
||||
<li>Reduced input lag on touch screens significantly</li>
|
||||
<li>Complet UI redesign for a more compact view</li>
|
||||
<li>Add French translation</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="0.4.0" date="2023-04-23" >
|
||||
<description>
|
||||
<p>Bug fixes, UI improvements and GNOME 44 runtime</p>
|
||||
|
|
|
@ -55,4 +55,8 @@ install_data(
|
|||
install_data(
|
||||
'map-symbolic.svg',
|
||||
install_dir: join_paths(get_option('datadir'), 'icons')
|
||||
)
|
||||
install_data(
|
||||
'view-sidebar-start-symbolic.svg',
|
||||
install_dir: join_paths(get_option('datadir'), 'icons')
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="#2e3436">
|
||||
<path d="m 6.5 14 v -12 h -5 v 12 z m 0 0" fill-opacity="0.35"/>
|
||||
<path d="m 3 1 c -1.644531 0 -3 1.355469 -3 3 v 8 c 0 1.644531 1.355469 3 3 3 h 10 c 1.644531 0 3 -1.355469 3 -3 v -8 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 10 c 0.570312 0 1 0.429688 1 1 v 8 c 0 0.570312 -0.429688 1 -1 1 h -10 c -0.570312 0 -1 -0.429688 -1 -1 v -8 c 0 -0.570312 0.429688 -1 1 -1 z m 0 0"/>
|
||||
<path d="m 6 2 h 1 v 12 h -1 z m 0 0"/>
|
||||
</g>
|
||||
</svg>
|
Po Szerokość: | Wysokość: | Rozmiar: 607 B |
|
@ -126,7 +126,7 @@
|
|||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "~/Projekte/picplanner"
|
||||
"url" : "~/Projekte/picplanner-circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
project('picplanner', 'c',
|
||||
version: '0.3.2',
|
||||
version: '0.4.1',
|
||||
meson_version: '>= 0.50.0',
|
||||
default_options: [ 'warning_level=2',
|
||||
'c_std=gnu11',
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
* draw-layer.c
|
||||
* Copyright (C) 2008-2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
|
||||
* Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
|
||||
* Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
|
||||
* Copyright (C) 2021 Zwarf <zwarf@mail.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
* draw-layer.h
|
||||
* Copyright (C) 2008-2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
|
||||
* Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
|
||||
* Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
|
||||
* Copyright (C) 2021 Zwarf <zwarf@mail.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
* marker.c
|
||||
* Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
|
||||
* Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
|
||||
* Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
|
||||
* Copyright (C) 2021 Zwarf <zwarf@mail.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
* marker.h
|
||||
* Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
|
||||
* Copyright (C) 2011-2013 Jiri Techet <techet@gmail.com>
|
||||
* Copyright (C) 2019 Marcus Lundblad <ml@update.uu.se>
|
||||
* Copyright (C) 2021 Zwarf <zwarf@mail.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -143,7 +143,7 @@ picplanner_application_show_about (GSimpleAction *action,
|
|||
"application-icon", "de.zwarf.picplanner",
|
||||
"application-name", "PicPlanner",
|
||||
"developer-name", "Zwarf",
|
||||
"version", "0.4.0",
|
||||
"version", "0.4.1",
|
||||
"website", "https://gitlab.com/Zwarf/picplanner",
|
||||
"issue-url", "https://gitlab.com/Zwarf/picplanner/-/issues/new",
|
||||
"copyright", copyright,
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
<file alias="azimuth-symbolic.svg">../data/icons/azimuth-symbolic.svg</file>
|
||||
<file alias="elevation-symbolic.svg">../data/icons/elevation-symbolic.svg</file>
|
||||
<file alias="map-symbolic.svg">../data/icons/map-symbolic.svg</file>
|
||||
<file alias="view-sidebar-start-symbolic.svg">../data/icons/view-sidebar-start-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
|
|
@ -31,6 +31,7 @@ struct _TimePicker
|
|||
|
||||
GtkWidget *spin_button_hour;
|
||||
GtkWidget *spin_button_minute;
|
||||
GtkWidget *time_button;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (TimePicker, time_picker, GTK_TYPE_BOX)
|
||||
|
@ -120,6 +121,17 @@ input_changed (GtkWidget *self,
|
|||
{
|
||||
(void) self;
|
||||
|
||||
|
||||
char *time_button_text;
|
||||
|
||||
time_button_text = g_strdup_printf ("%02.f:%02.f",
|
||||
gtk_spin_button_get_value (GTK_SPIN_BUTTON (time_picker->spin_button_hour)),
|
||||
gtk_spin_button_get_value (GTK_SPIN_BUTTON (time_picker->spin_button_minute)));
|
||||
|
||||
gtk_menu_button_set_label (GTK_MENU_BUTTON (time_picker->time_button), time_button_text);
|
||||
|
||||
g_free (time_button_text);
|
||||
|
||||
g_signal_emit (time_picker,
|
||||
signal_change,
|
||||
0, NULL);
|
||||
|
@ -149,6 +161,7 @@ time_spin_button_text (GtkSpinButton *self)
|
|||
/*
|
||||
* Change the text of the button which presents the calender after a date was selected.
|
||||
* Furthermore the behavior of the popup is controlled.
|
||||
* TODO: combine with input_changed function
|
||||
*/
|
||||
static void
|
||||
day_selected (GtkCalendar *self,
|
||||
|
@ -215,6 +228,7 @@ time_picker_class_init (TimePickerClass *class)
|
|||
gtk_widget_class_bind_template_child (widget_class, TimePicker, calendar_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, TimePicker, spin_button_hour);
|
||||
gtk_widget_class_bind_template_child (widget_class, TimePicker, spin_button_minute);
|
||||
gtk_widget_class_bind_template_child (widget_class, TimePicker, time_button);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, day_selected);
|
||||
gtk_widget_class_bind_template_callback (widget_class, time_spin_button_text);
|
||||
|
|
|
@ -18,6 +18,51 @@
|
|||
</child>
|
||||
</object>
|
||||
|
||||
<object class="GtkPopover" id="time_popover">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="spin_button_hour">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">h_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<signal name="output" handler="time_spin_button_text"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="margin_start">5</property>
|
||||
<property name="margin_end">5</property>
|
||||
<property name="label">∶</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="spin_button_minute">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">m_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<signal name="output" handler="time_spin_button_text"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_time_zone">
|
||||
<property name="margin_top">7</property>
|
||||
<property name="margin_bottom">3</property>
|
||||
<property name="label">UTC: </property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
<template class="TimePicker" parent="GtkBox">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="halign">fill</property>
|
||||
|
@ -27,47 +72,21 @@
|
|||
<property name="orientation">horizontal</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="calendar_button">
|
||||
<property name="label">01.01.2022</property>
|
||||
<property name="popover">calendar_popover</property>
|
||||
<property name="margin-end">25</property>
|
||||
<property name="vexpand">false</property>
|
||||
<property name="valign">center</property>
|
||||
<signal name="realize" handler="day_selected"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="spin_button_hour">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">h_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<signal name="output" handler="time_spin_button_text"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="margin_start">5</property>
|
||||
<property name="margin_end">5</property>
|
||||
<property name="label">∶</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="spin_button_minute">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">m_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<signal name="output" handler="time_spin_button_text"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_time_zone">
|
||||
<property name="margin_start">20</property>
|
||||
<property name="label">UTC: </property>
|
||||
<object class="GtkMenuButton" id="time_button">
|
||||
<property name="label">12:00</property>
|
||||
<property name="popover">time_popover</property>
|
||||
<property name="vexpand">false</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
|
|
@ -39,6 +39,10 @@ struct _PicplannerOverview
|
|||
GtkWidget *switch_moon;
|
||||
GtkWidget *switch_milky_way;
|
||||
|
||||
GtkWidget *switch_to_sun_stack;
|
||||
GtkWidget *switch_to_moon_stack;
|
||||
GtkWidget *switch_to_milky_way_stack;
|
||||
|
||||
GtkWidget *label_sun_rise;
|
||||
GtkWidget *label_sun_set;
|
||||
GtkWidget *label_moon_rise;
|
||||
|
@ -82,6 +86,42 @@ struct _PicplannerOverview
|
|||
|
||||
|
||||
G_DEFINE_TYPE (PicplannerOverview, picplanner_overview, GTK_TYPE_BOX)
|
||||
|
||||
/*
|
||||
* Catch all signals from the buttons and emit a signal which can be used by
|
||||
* picplanner-window to change the stack page.
|
||||
*/
|
||||
static guint signal_button_pressed;
|
||||
void
|
||||
change_stack_page (GtkButton *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
int stack_page = 0;
|
||||
PicplannerOverview *overview = user_data;
|
||||
|
||||
if (self == GTK_BUTTON(overview->switch_to_sun_stack))
|
||||
{
|
||||
g_print("Button Sun\n");
|
||||
stack_page = 1;
|
||||
}
|
||||
else if (self == GTK_BUTTON(overview->switch_to_moon_stack))
|
||||
{
|
||||
g_print("Button Moon\n");
|
||||
stack_page = 2;
|
||||
}
|
||||
else if (self == GTK_BUTTON(overview->switch_to_milky_way_stack))
|
||||
{
|
||||
g_print("Button Milky Way\n");
|
||||
stack_page = 3;
|
||||
}
|
||||
|
||||
|
||||
g_signal_emit (overview,
|
||||
signal_button_pressed,
|
||||
0, stack_page);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
input_rebounce_reset_signal (gpointer user_data)
|
||||
{
|
||||
|
@ -109,6 +149,9 @@ input_timeout_signal (gpointer user_data)
|
|||
g_settings_set_double (overview->settings,
|
||||
"latitude" ,
|
||||
shumate_location_get_latitude (SHUMATE_LOCATION(overview->viewport)));
|
||||
g_settings_set_double (overview->settings,
|
||||
"zoom-level",
|
||||
shumate_viewport_get_zoom_level (overview->viewport));
|
||||
g_source_remove (overview->input_timeout_id);
|
||||
}
|
||||
overview->input_count = 0;
|
||||
|
@ -135,14 +178,16 @@ input_changed (GtkWidget *self,
|
|||
input_timeout_signal,
|
||||
overview);
|
||||
}
|
||||
//picplanner_overview_remove_map_content (overview);
|
||||
// TODO: Remove content asynchronous?
|
||||
overview->input_count++;
|
||||
picplanner_overview_remove_map_content (overview);
|
||||
}
|
||||
else
|
||||
{
|
||||
shumate_location_set_location (SHUMATE_LOCATION (overview->viewport),
|
||||
g_settings_get_double (overview->settings, "latitude"),
|
||||
g_settings_get_double (overview->settings, "longitude"));
|
||||
shumate_viewport_set_zoom_level (overview->viewport, g_settings_get_double (overview->settings, "zoom-level"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -682,14 +727,10 @@ picplanner_overview_init (PicplannerOverview *overview)
|
|||
"changed::latitude",
|
||||
G_CALLBACK (input_changed),
|
||||
overview);
|
||||
|
||||
g_settings_bind (overview->settings, "map-fullscreen",
|
||||
overview->basic_information, "visible",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (overview->settings, "zoom-level",
|
||||
overview->viewport, "zoom-level",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_signal_connect (G_OBJECT (overview->viewport),
|
||||
"notify::zoom-level",
|
||||
G_CALLBACK (input_changed),
|
||||
overview);
|
||||
|
||||
g_settings_bind (overview->settings, "sun-visible",
|
||||
overview->switch_sun, "active",
|
||||
|
@ -721,6 +762,23 @@ picplanner_overview_init (PicplannerOverview *overview)
|
|||
G_CALLBACK (shumate_map_metric_imperial_scale),
|
||||
overview);
|
||||
|
||||
/*
|
||||
* Register the button presses to switch the few
|
||||
*/
|
||||
|
||||
g_signal_connect (G_OBJECT (overview->switch_to_sun_stack),
|
||||
"clicked",
|
||||
G_CALLBACK (change_stack_page),
|
||||
overview);
|
||||
g_signal_connect (G_OBJECT (overview->switch_to_moon_stack),
|
||||
"clicked",
|
||||
G_CALLBACK (change_stack_page),
|
||||
overview);
|
||||
g_signal_connect (G_OBJECT (overview->switch_to_milky_way_stack),
|
||||
"clicked",
|
||||
G_CALLBACK (change_stack_page),
|
||||
overview);
|
||||
|
||||
|
||||
/*
|
||||
* Initialisation of values needed to detect when a user input ends
|
||||
|
@ -745,6 +803,9 @@ picplanner_overview_class_init (PicplannerOverviewClass *class)
|
|||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_sun);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_moon);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_milky_way);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_to_sun_stack);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_to_moon_stack);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, switch_to_milky_way_stack);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_sun_rise);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_sun_set);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_moon_rise);
|
||||
|
@ -758,6 +819,13 @@ picplanner_overview_class_init (PicplannerOverviewClass *class)
|
|||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_azimuth_moon);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, label_azimuth_milky_way);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerOverview, basic_information);
|
||||
|
||||
signal_button_pressed = g_signal_new ("change-stack",
|
||||
G_OBJECT_CLASS_TYPE (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
1, G_TYPE_INT);
|
||||
}
|
||||
|
||||
PicplannerOverview *
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkSwitch" id="sun_switch_button">
|
||||
<property name="vexpand">false</property>
|
||||
<property name="hexpand">false</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<object class="GtkSwitch" id="moon_switch_button">
|
||||
<property name="vexpand">false</property>
|
||||
<property name="hexpand">false</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<object class="GtkSwitch" id="milky_way_switch_button">
|
||||
<property name="vexpand">false</property>
|
||||
<property name="hexpand">false</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
|
||||
|
||||
<template class="PicplannerOverview" parent="GtkBox">
|
||||
|
||||
<child>
|
||||
|
@ -18,235 +38,252 @@
|
|||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="AdwPreferencesRow">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="column-spacing">12</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<object class="AdwPreferencesRow">
|
||||
<property name="activatable">false</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_sun">
|
||||
<property name="active">true</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_moon">
|
||||
<property name="active">true</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_milky_way">
|
||||
<property name="active">true</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Sun</property>
|
||||
<property name="halign">start</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Moon</property>
|
||||
<property name="halign">start</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Milky Way</property>
|
||||
<property name="halign">start</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">daytime-sunrise-symbolic</property>
|
||||
<property name="pixel-size">24</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">daytime-sunset-symbolic</property>
|
||||
<property name="pixel-size">24</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkGrid">
|
||||
<property name="column-homogeneous">false</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="margin-start">8</property>
|
||||
<property name="margin-end">8</property>
|
||||
<property name="margin-top">8</property>
|
||||
<property name="margin-bottom">8</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_sun">
|
||||
<property name="active">true</property>
|
||||
<property name="tooltip-text">Show sun</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_moon">
|
||||
<property name="active">true</property>
|
||||
<property name="tooltip-text">Show moon</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="switch_milky_way">
|
||||
<property name="active">true</property>
|
||||
<property name="tooltip-text">Show milky way</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="switch_to_sun_stack">
|
||||
<property name="label" translatable="yes">Sun</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="hexpand">true</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="switch_to_moon_stack">
|
||||
<property name="label" translatable="yes">Moon</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="hexpand">true</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="switch_to_milky_way_stack">
|
||||
<property name="label" translatable="yes">Milky Way</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="hexpand">true</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">daytime-sunrise-symbolic</property>
|
||||
<property name="pixel-size">24</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text">Rise</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">daytime-sunset-symbolic</property>
|
||||
<property name="pixel-size">24</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text">Set</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_sun_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_sun_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_moon_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_moon_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_milky_way_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_milky_way_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">elevation-symbolic</property>
|
||||
<property name="icon-size">GTK_ICON_SIZE_LARGE</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">azimuth-symbolic</property>
|
||||
<property name="icon-size">GTK_ICON_SIZE_LARGE</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_sun">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_moon">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_milky_way">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_sun">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_moon">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_milky_way">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_sun_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_sun_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_moon_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_moon_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_milky_way_rise">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_milky_way_set">
|
||||
<property name="label">12:00</property>
|
||||
<layout>
|
||||
<property name="column">3</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">elevation-symbolic</property>
|
||||
<property name="icon-size">GTK_ICON_SIZE_LARGE</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text">Elevation</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">azimuth-symbolic</property>
|
||||
<property name="icon-size">GTK_ICON_SIZE_LARGE</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text">Azimuth</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_sun">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_moon">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_elevation_milky_way">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">4</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_sun">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_moon">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_azimuth_milky_way">
|
||||
<property name="label">0°</property>
|
||||
<layout>
|
||||
<property name="column">5</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
@ -258,9 +295,13 @@
|
|||
|
||||
<child>
|
||||
<object class="AdwBin">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<child>
|
||||
<object class="ShumateSimpleMap" id="map">
|
||||
<property name="width-request">300</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
@ -0,0 +1,710 @@
|
|||
/*
|
||||
* picplanner-window.c
|
||||
* Copyright (C) 2021 Zwarf <zwarf@mail.de>
|
||||
*
|
||||
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "window/picplanner-window.h"
|
||||
#include "window/overview-page/overview-view.h"
|
||||
#include "window/sun-page/sun-view.h"
|
||||
#include "window/moon-page/moon-view.h"
|
||||
#include "window/milky-way-page/milky-way-view.h"
|
||||
#include "calculations/calculations_sun.h"
|
||||
#include "calculations/calculations_moon.h"
|
||||
#include "calculations/calculations_milky_way.h"
|
||||
#include "time-picker/time-picker.h"
|
||||
|
||||
|
||||
/*
|
||||
* The time of no input of map movement that has to pass until a calculation of the positions
|
||||
* of sun, moon or milky way starts.
|
||||
*/
|
||||
#define INPUT_CHANGED_TIMEOUT_LENGTH 50
|
||||
|
||||
|
||||
struct _PicplannerWindow
|
||||
{
|
||||
GtkApplicationWindow parent_instance;
|
||||
|
||||
/* Template widgets */
|
||||
GtkHeaderBar *header_bar;
|
||||
GtkWidget *box_main;
|
||||
GtkWidget *stack; /* Stack containing overview, sun, moon and milky way page */
|
||||
GtkWidget *search_bar; /* Search bar for the location */
|
||||
GtkWidget *search_entry; /* The search entry inside the search bar */
|
||||
GtkWidget *search_button; /* The search button in the header bar so show the search bar */
|
||||
GtkWidget *map_button; /* The map button in the header bar to show the map fullscreen */
|
||||
GtkWidget *location_button; /* Button in the header bar to start the GPS search of the device location */
|
||||
GtkWidget *overview_box; /* The overview page */
|
||||
GtkWidget *sun_box; /* The sun page */
|
||||
GtkWidget *moon_box; /* The moon page */
|
||||
GtkWidget *milky_way_box; /* The milky way page */
|
||||
GtkWidget *north_entry; /* SpinButton for North coordinates */
|
||||
GtkWidget *east_entry; /* SpinButton for East coordinates */
|
||||
GtkWidget *clamp_time_selector;
|
||||
GtkWidget *overview_page;
|
||||
GtkWidget *time_picker;
|
||||
|
||||
/* Search functionality */
|
||||
GtkWidget *search_result_box; /* ListBox containing search results */
|
||||
GtkWidget *search_results_scroll; /* ScrollView containing search_result_box */
|
||||
GtkWidget *search_result_row[NUM_SEARCH_RESULTS]; /* Row widget for every search result */
|
||||
GtkWidget *search_result_label[NUM_SEARCH_RESULTS]; /* The label showing the coordinates */
|
||||
GWeatherLocation *search_result_location[NUM_SEARCH_RESULTS]; /* The location information for every search result */
|
||||
|
||||
/* Regulating amount of inputs per time */
|
||||
gint input_count;
|
||||
guint input_timeout_id;
|
||||
gboolean input_new;
|
||||
|
||||
/* All settings of PicPlanner */
|
||||
GSettings *settings;
|
||||
|
||||
GDateTime *date_time;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (PicplannerWindow, picplanner_window, ADW_TYPE_APPLICATION_WINDOW)
|
||||
|
||||
|
||||
/*
|
||||
* Function used after the user selects a search result
|
||||
*/
|
||||
static void
|
||||
search_location_chosen (GtkWidget *self,
|
||||
GtkWidget *row,
|
||||
gpointer user_data)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window = user_data;
|
||||
double latitude;
|
||||
double longitude;
|
||||
double *p_latitude = &latitude;
|
||||
double *p_longitude = &longitude;
|
||||
|
||||
int i;
|
||||
for (i=0; i<NUM_SEARCH_RESULTS; i++)
|
||||
{
|
||||
if (row == window->search_result_row[i])
|
||||
break;
|
||||
}
|
||||
gweather_location_get_coords (GWEATHER_LOCATION (window->search_result_location[i]),
|
||||
p_latitude,
|
||||
p_longitude);
|
||||
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (window->search_bar),
|
||||
FALSE);
|
||||
|
||||
g_settings_set_double (window->settings, "latitude", latitude);
|
||||
g_settings_set_double (window->settings, "longitude", longitude);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function activated after user input into the search entry.
|
||||
* TODO: Rewrite with dynamic memory? to search.c
|
||||
* This function is more like a work around and will definitely be changed.
|
||||
*/
|
||||
static void
|
||||
search_location (GtkWidget *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window = user_data;
|
||||
|
||||
const char *search_text = gtk_editable_get_text (GTK_EDITABLE (window->search_entry));
|
||||
|
||||
char *search_norm = g_utf8_normalize (search_text, strlen (search_text), G_NORMALIZE_ALL_COMPOSE);
|
||||
char *search_string = g_utf8_casefold (search_text, strlen (search_norm));
|
||||
|
||||
g_autoptr (GWeatherLocation) world = NULL;
|
||||
|
||||
world = gweather_location_get_world ();
|
||||
|
||||
for (int i=0; i<NUM_SEARCH_RESULTS; i++)
|
||||
{
|
||||
if (GWEATHER_IS_LOCATION (window->search_result_location[i]))
|
||||
g_object_unref (window->search_result_location[i]);
|
||||
window->search_result_location[i] = NULL;
|
||||
}
|
||||
|
||||
if (!strstr ("", search_string))
|
||||
{
|
||||
int iter = 0;
|
||||
int *iteration = &iter;
|
||||
|
||||
double longitude;
|
||||
double latitude;
|
||||
double *p_longitude = &longitude;
|
||||
double *p_latitude = &latitude;
|
||||
|
||||
char *char_coordinates;
|
||||
char *char_subtitle;
|
||||
|
||||
gtk_widget_set_visible (window->stack, FALSE);
|
||||
gtk_widget_set_visible (window->clamp_time_selector, FALSE);
|
||||
gtk_widget_set_visible (window->search_results_scroll, TRUE);
|
||||
|
||||
find_loc_children (world, search_string, window->search_result_location, iteration);
|
||||
|
||||
for (int i=0; i<NUM_SEARCH_RESULTS; i++)
|
||||
{
|
||||
if (GTK_IS_WIDGET (window->search_result_row[i]))
|
||||
{
|
||||
gtk_list_box_remove (GTK_LIST_BOX (window->search_result_box),
|
||||
window->search_result_row[i]);
|
||||
}
|
||||
|
||||
window->search_result_row[i] = NULL;
|
||||
|
||||
if (window->search_result_location[i])
|
||||
{
|
||||
window->search_result_row[i] = adw_action_row_new ();
|
||||
gweather_location_get_coords (window->search_result_location[i],
|
||||
p_latitude, p_longitude);
|
||||
char_coordinates = g_strdup_printf ("N: %.04f\nE: %.04f", latitude, longitude);
|
||||
|
||||
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (window->search_result_row[i]),
|
||||
gweather_location_get_name (window->search_result_location[i]));
|
||||
if (gweather_location_get_level (
|
||||
gweather_location_get_parent (window->search_result_location[i])) == GWEATHER_LOCATION_COUNTRY ||
|
||||
gweather_location_get_level (window->search_result_location[i]) == GWEATHER_LOCATION_COUNTRY)
|
||||
char_subtitle = g_strdup_printf ("%s",
|
||||
gweather_location_get_country_name (window->search_result_location[i]));
|
||||
else
|
||||
char_subtitle = g_strdup_printf ("%s, %s",
|
||||
gweather_location_get_name (gweather_location_get_parent (window->search_result_location[i])),
|
||||
gweather_location_get_country_name (window->search_result_location[i]));
|
||||
|
||||
|
||||
adw_action_row_set_subtitle (ADW_ACTION_ROW (window->search_result_row[i]),
|
||||
char_subtitle);
|
||||
|
||||
window->search_result_label[i] = gtk_label_new (char_coordinates);
|
||||
|
||||
adw_action_row_add_suffix (ADW_ACTION_ROW (window->search_result_row[i]),
|
||||
window->search_result_label[i]);
|
||||
|
||||
gtk_widget_set_can_focus (window->search_result_row[i], TRUE);
|
||||
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (window->search_result_row[i]), TRUE);
|
||||
gtk_list_box_row_set_selectable (GTK_LIST_BOX_ROW (window->search_result_row[i]), TRUE);
|
||||
|
||||
gtk_list_box_append (GTK_LIST_BOX (window->search_result_box),
|
||||
window->search_result_row[i]);
|
||||
|
||||
g_free (char_coordinates);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
gtk_widget_set_visible (window->stack, TRUE);
|
||||
gtk_widget_set_visible (window->clamp_time_selector, TRUE);
|
||||
gtk_widget_set_visible (window->search_results_scroll, FALSE);
|
||||
}
|
||||
|
||||
g_free (search_norm);
|
||||
g_free (search_string);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide the map fullscreen button if the active view is not "page1" (overview)
|
||||
*/
|
||||
static void
|
||||
stack_changed (AdwViewStack *self,
|
||||
gpointer pspec,
|
||||
PicplannerWindow *window)
|
||||
{
|
||||
(void) pspec;
|
||||
if (!strcmp(adw_view_stack_get_visible_child_name (self),"page1"))
|
||||
gtk_widget_set_visible (window->map_button, TRUE);
|
||||
else
|
||||
gtk_widget_set_visible (window->map_button, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
picplanner_set_location (double latitude, double longitude, PicplannerWindow *window)
|
||||
{
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (window->north_entry), latitude);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (window->east_entry), longitude);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Changing the date_time variable after a user input was recognized.
|
||||
* Afterwards, emit a signal to start the calculations.
|
||||
*/
|
||||
void
|
||||
picplanner_update_date_time (PicplannerWindow *window)
|
||||
{
|
||||
int year, month, day, hour, minute;
|
||||
|
||||
double latitude, longitude;
|
||||
GWeatherLocation *loc;
|
||||
|
||||
longitude = gtk_spin_button_get_value (GTK_SPIN_BUTTON (window->east_entry));
|
||||
latitude = gtk_spin_button_get_value (GTK_SPIN_BUTTON (window->north_entry));
|
||||
loc = gweather_location_new_detached ("Custom Location", NULL, latitude, longitude);
|
||||
|
||||
year = time_picker_get_year (TIME_PICKER (window->time_picker));
|
||||
month = time_picker_get_month (TIME_PICKER (window->time_picker));
|
||||
day = time_picker_get_day (TIME_PICKER (window->time_picker));
|
||||
hour = time_picker_get_hour (TIME_PICKER (window->time_picker));
|
||||
minute = time_picker_get_minute (TIME_PICKER (window->time_picker));
|
||||
|
||||
|
||||
/*
|
||||
* Save the information into the date_time variable.
|
||||
* The time zone is either selected automatically or taken from the input spin button in the preference dialog.
|
||||
*/
|
||||
if (!g_settings_get_boolean (window->settings, "time-zone-manual"))
|
||||
{
|
||||
window->date_time = g_date_time_new (gweather_location_get_timezone (loc),
|
||||
year, month, day,
|
||||
hour, minute,
|
||||
0);
|
||||
g_settings_set_double (window->settings,
|
||||
"time-zone",
|
||||
(double) g_date_time_get_utc_offset (window->date_time)/3600/1000/1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
window->date_time = g_date_time_new (g_time_zone_new_offset ((int) (g_settings_get_double (window->settings, "time-zone")*3600)),
|
||||
year, month, day,
|
||||
hour, minute,
|
||||
0);
|
||||
}
|
||||
|
||||
double time_zone = (double) g_date_time_get_utc_offset (window->date_time)/3600/1000/1000;
|
||||
time_picker_set_time_zone (TIME_PICKER (window->time_picker),
|
||||
time_zone);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Starts the main calculations.
|
||||
* 1. The necessary information is collected from the inputs.
|
||||
* 2. The position sun, moon and milky way are calculated.
|
||||
* 3. The calculated data is handed over to the views which then provide the information to the users.
|
||||
*/
|
||||
static void
|
||||
calculate_positions (PicplannerWindow *window)
|
||||
{
|
||||
int current_index;
|
||||
int phase_moon_index;
|
||||
|
||||
double longitude, latitude;
|
||||
double illumination_moon, illumination_moon_later;
|
||||
|
||||
int *rise_upper_set_lower_index_sun;
|
||||
int *rise_upper_set_index_moon;
|
||||
int *rise_upper_set_index_milky_way;
|
||||
int *dark_blue_golden_index;
|
||||
|
||||
double *array_coordinates_sun;
|
||||
double *array_coordinates_moon;
|
||||
double *array_coordinates_milky_way;
|
||||
|
||||
char *phase_moon;
|
||||
|
||||
GDateTime *date_time_noon;
|
||||
GDateTime *date_time_later;
|
||||
|
||||
|
||||
longitude = gtk_spin_button_get_value (GTK_SPIN_BUTTON (window->east_entry));
|
||||
latitude = gtk_spin_button_get_value (GTK_SPIN_BUTTON (window->north_entry));
|
||||
|
||||
picplanner_update_date_time (window);
|
||||
|
||||
date_time_noon = g_date_time_new (g_date_time_get_timezone (window->date_time),
|
||||
g_date_time_get_year (window->date_time),
|
||||
g_date_time_get_month (window->date_time),
|
||||
g_date_time_get_day_of_month (window->date_time),
|
||||
12, 0, 0);
|
||||
|
||||
current_index = g_date_time_difference (window->date_time, date_time_noon)/1000/1000/60 * NUM_DATA_POINTS/24/60 + NUM_DATA_POINTS/2;
|
||||
|
||||
/*
|
||||
* Sun
|
||||
*/
|
||||
|
||||
array_coordinates_sun = picplanner_get_array_coordinates_sun (date_time_noon,
|
||||
longitude,
|
||||
latitude);
|
||||
|
||||
rise_upper_set_lower_index_sun = picplanner_get_index_rise_upper_set_lower (array_coordinates_sun);
|
||||
dark_blue_golden_index = picplanner_get_index_dark_blue_golden (array_coordinates_sun);
|
||||
|
||||
picplanner_overview_set_current_coordinates_sun (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_sun,
|
||||
rise_upper_set_lower_index_sun,
|
||||
current_index,
|
||||
window->date_time);
|
||||
|
||||
picplanner_sun_set_rise_upper_set (PICPLANNER_SUN (window->sun_box),
|
||||
date_time_noon,
|
||||
array_coordinates_sun,
|
||||
rise_upper_set_lower_index_sun);
|
||||
|
||||
picplanner_sun_set_dark_blue_golden (PICPLANNER_SUN (window->sun_box),
|
||||
date_time_noon,
|
||||
dark_blue_golden_index);
|
||||
|
||||
|
||||
/*
|
||||
* Moon
|
||||
*/
|
||||
array_coordinates_moon = picplanner_get_array_coordinates_moon (date_time_noon,
|
||||
longitude,
|
||||
latitude);
|
||||
|
||||
rise_upper_set_index_moon = picplanner_get_index_rise_upper_set_lower (array_coordinates_moon);
|
||||
|
||||
|
||||
picplanner_overview_set_current_coordinates_moon (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_moon,
|
||||
rise_upper_set_index_moon,
|
||||
current_index,
|
||||
window->date_time);
|
||||
|
||||
picplanner_moon_set_rise_upper_set (PICPLANNER_MOON (window->moon_box),
|
||||
date_time_noon,
|
||||
array_coordinates_moon,
|
||||
rise_upper_set_index_moon);
|
||||
|
||||
|
||||
date_time_later = g_date_time_add_hours (window->date_time, 1);
|
||||
illumination_moon = picplanner_get_illumination (window->date_time);
|
||||
illumination_moon_later = picplanner_get_illumination (date_time_later);
|
||||
if (illumination_moon > 99.5)
|
||||
{
|
||||
phase_moon_index = 0;
|
||||
phase_moon = g_strdup_printf ("Full Moon");
|
||||
}
|
||||
else if (illumination_moon_later >= illumination_moon && illumination_moon > 0.5)
|
||||
{
|
||||
phase_moon_index = 1;
|
||||
phase_moon = g_strdup_printf ("Waxing Moon");
|
||||
}
|
||||
else if (illumination_moon_later < illumination_moon && illumination_moon > 0.5)
|
||||
{
|
||||
phase_moon_index = 2;
|
||||
phase_moon = g_strdup_printf ("Waning Moon");
|
||||
}
|
||||
else
|
||||
{
|
||||
phase_moon_index = 3;
|
||||
phase_moon = g_strdup_printf ("New Moon");
|
||||
}
|
||||
picplanner_moon_set_illumination_intensity (PICPLANNER_MOON (window->moon_box),
|
||||
illumination_moon,
|
||||
phase_moon);
|
||||
|
||||
|
||||
/*
|
||||
* Milky Way
|
||||
*/
|
||||
array_coordinates_milky_way = picplanner_get_array_coordinates_milky_way (date_time_noon,
|
||||
longitude,
|
||||
latitude);
|
||||
|
||||
rise_upper_set_index_milky_way = picplanner_get_index_rise_upper_set_lower (array_coordinates_milky_way);
|
||||
|
||||
picplanner_overview_set_current_coordinates_milky_way (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_milky_way,
|
||||
rise_upper_set_index_milky_way,
|
||||
current_index,
|
||||
window->date_time);
|
||||
|
||||
picplanner_milky_way_set_rise_upper_set (PICPLANNER_MILKYWAY (window->milky_way_box),
|
||||
date_time_noon,
|
||||
array_coordinates_milky_way,
|
||||
rise_upper_set_index_milky_way);
|
||||
|
||||
|
||||
picplanner_milky_way_set_disturbance (PICPLANNER_MILKYWAY (window->milky_way_box),
|
||||
date_time_noon,
|
||||
array_coordinates_sun,
|
||||
array_coordinates_moon,
|
||||
array_coordinates_milky_way);
|
||||
|
||||
|
||||
/*
|
||||
* Update Shumate Map
|
||||
*/
|
||||
picplanner_overview_update_map_center (PICPLANNER_OVERVIEW (window->overview_box));
|
||||
|
||||
|
||||
if (g_settings_get_boolean (window->settings, "sun-visible"))
|
||||
{
|
||||
picplanner_overview_update_map_sun (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_sun,
|
||||
current_index,
|
||||
rise_upper_set_lower_index_sun);
|
||||
|
||||
}
|
||||
|
||||
if (g_settings_get_boolean (window->settings, "moon-visible"))
|
||||
{
|
||||
picplanner_overview_update_map_moon (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_moon,
|
||||
current_index,
|
||||
rise_upper_set_index_moon,
|
||||
phase_moon_index);
|
||||
}
|
||||
|
||||
if (g_settings_get_boolean (window->settings, "milky-way-visible"))
|
||||
{
|
||||
picplanner_overview_update_map_milky_way (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_milky_way,
|
||||
current_index,
|
||||
rise_upper_set_index_milky_way);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free allocated memory
|
||||
*/
|
||||
g_free (rise_upper_set_lower_index_sun);
|
||||
g_free (rise_upper_set_index_moon);
|
||||
g_free (rise_upper_set_index_milky_way);
|
||||
g_free (dark_blue_golden_index);
|
||||
g_free (array_coordinates_sun);
|
||||
g_free (array_coordinates_moon);
|
||||
g_free (array_coordinates_milky_way);
|
||||
g_free (phase_moon);
|
||||
g_date_time_unref (date_time_noon);
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Free loc?
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* input_timeout_signal:
|
||||
* If the timer has been running out it is checked if the counter was increased during the time
|
||||
* or not. If it has been increased it is reseted to 0 and the timer continues.
|
||||
* If no input was detected in the meantime (input_counter==0) a new detection series is
|
||||
* initialized by setting input_new = TRUE. Furthermore the userinput is saved with
|
||||
* change_date_time and the timer is deactivated.
|
||||
*/
|
||||
static gboolean
|
||||
input_timeout_signal (gpointer user_data)
|
||||
{
|
||||
PicplannerWindow *window = PICPLANNER_WINDOW (user_data);
|
||||
if (window->input_count == 0)
|
||||
{
|
||||
window->input_new = TRUE;
|
||||
calculate_positions (window);
|
||||
g_source_remove (window->input_timeout_id);
|
||||
}
|
||||
window->input_count = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* input_changed:
|
||||
* Function to call if the user changes the location or date/time.
|
||||
* At the beginning input_new is TRUE because a new input starts.
|
||||
* The input_new variable is set to FALSE if a user input is detected, and a timer is started.
|
||||
* The input_count is increased from now on by one, every time a user input is detected.
|
||||
*/
|
||||
static void
|
||||
input_changed (GtkWidget *self,
|
||||
gpointer data_map_move,
|
||||
gpointer data_window_change)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window;
|
||||
|
||||
if (PICPLANNER_IS_WINDOW (data_window_change))
|
||||
window = PICPLANNER_WINDOW (data_window_change);
|
||||
else
|
||||
window = PICPLANNER_WINDOW (data_map_move);
|
||||
|
||||
if (window->input_new)
|
||||
{
|
||||
window->input_new = FALSE;
|
||||
window->input_timeout_id = g_timeout_add (INPUT_CHANGED_TIMEOUT_LENGTH,
|
||||
input_timeout_signal,
|
||||
window);
|
||||
}
|
||||
|
||||
picplanner_overview_update_map_center (PICPLANNER_OVERVIEW (window->overview_box));
|
||||
|
||||
window->input_count++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Remove all children on the map and cause a new input_changed event.
|
||||
*/
|
||||
static void
|
||||
input_changed_remove_content (GtkWidget *self,
|
||||
gpointer data_map_move,
|
||||
gpointer data_window_change)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window;
|
||||
|
||||
if (PICPLANNER_IS_WINDOW (data_window_change))
|
||||
window = PICPLANNER_WINDOW (data_window_change);
|
||||
else
|
||||
window = PICPLANNER_WINDOW (data_map_move);
|
||||
|
||||
if (window->input_new)
|
||||
picplanner_overview_remove_map_content (PICPLANNER_OVERVIEW (window->overview_box));
|
||||
|
||||
input_changed (self, data_map_move, window);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
picplanner_window_class_init (PicplannerWindowClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
g_type_ensure (PICPLANNER_OVERVIEW_TYPE);
|
||||
g_type_ensure (PICPLANNER_SUN_TYPE);
|
||||
g_type_ensure (PICPLANNER_MOON_TYPE);
|
||||
g_type_ensure (PICPLANNER_MILKYWAY_TYPE);
|
||||
g_type_ensure (TIME_PICKER_TYPE);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/de/zwarf/picplanner/window/picplanner-window.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, box_main);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, header_bar);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_bar);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, map_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, location_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, overview_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, sun_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, moon_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, milky_way_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, north_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, east_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_result_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_results_scroll);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, clamp_time_selector);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, overview_page);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, time_picker);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, search_location);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
picplanner_window_init (PicplannerWindow *window)
|
||||
{
|
||||
GTimeZone *timezone;
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
|
||||
window->settings = g_settings_new ("de.zwarf.picplanner");
|
||||
|
||||
timezone = g_time_zone_new_offset (g_settings_get_double (window->settings, "time-zone") * 3600);
|
||||
window->date_time = g_date_time_new_now (timezone);
|
||||
time_picker_set_date_time (TIME_PICKER (window->time_picker),
|
||||
window->date_time);
|
||||
|
||||
/*
|
||||
* Callbacks
|
||||
*/
|
||||
|
||||
g_settings_bind (window->settings, "longitude",
|
||||
window->east_entry, "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_settings_bind (window->settings, "latitude",
|
||||
window->north_entry, "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_settings_bind (window->settings, "map-fullscreen",
|
||||
window->map_button, "active",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_object_bind_property (window->search_button, "active",
|
||||
window->search_bar, "search-mode-enabled",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
|
||||
|
||||
g_signal_connect (G_OBJECT (window->settings),
|
||||
"changed::latitude",
|
||||
G_CALLBACK (input_changed),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->settings),
|
||||
"changed::longitude",
|
||||
G_CALLBACK (input_changed),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->settings),
|
||||
"changed::sun-visible",
|
||||
G_CALLBACK (input_changed_remove_content),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->settings),
|
||||
"changed::moon-visible",
|
||||
G_CALLBACK (input_changed_remove_content),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->settings),
|
||||
"changed::milky-way-visible",
|
||||
G_CALLBACK (input_changed_remove_content),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->search_result_box),
|
||||
"row-activated",
|
||||
G_CALLBACK (search_location_chosen),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->stack),
|
||||
"notify::visible-child",
|
||||
G_CALLBACK (stack_changed),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->location_button),
|
||||
"clicked",
|
||||
G_CALLBACK (get_user_location),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->time_picker),
|
||||
"date_time_changed",
|
||||
G_CALLBACK (input_changed),
|
||||
window);
|
||||
|
||||
/*
|
||||
* Initialisation of values needed to detect when a user input ends
|
||||
*/
|
||||
window->input_new = true;
|
||||
window->input_count = 0;
|
||||
window->input_timeout_id = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Setup the location searchbar to register keyboard input
|
||||
*/
|
||||
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (window->search_bar), GTK_EDITABLE (window->search_entry));
|
||||
gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (window->search_bar), GTK_WIDGET (window));
|
||||
|
||||
/*
|
||||
* Initial calculation after startup
|
||||
*/
|
||||
calculate_positions (window);
|
||||
}
|
|
@ -0,0 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="PicplannerOverview" id="overview_box">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
|
||||
<object class="PicplannerSun" id="sun_box">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
|
||||
<object class="PicplannerMoon" id="moon_box">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
|
||||
<object class="PicplannerMilkyway" id="milky_way_box">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
|
||||
<object class="GtkAdjustment" id="north_adjustment">
|
||||
<property name="upper">85.0511287798</property>
|
||||
<property name="lower">-85.0511287798</property>
|
||||
<property name="step_increment">0.01</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="east_adjustment">
|
||||
<property name="upper">180</property>
|
||||
<property name="lower">-180</property>
|
||||
<property name="step_increment">0.01</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
|
||||
<template class="PicplannerWindow" parent="AdwApplicationWindow">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
<property name="content">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwHeaderBar" id="header_bar">
|
||||
<property name="centering_policy">strict</property>
|
||||
|
||||
<child type="title">
|
||||
<object class="AdwViewSwitcherTitle" id="switcher_title">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="stack">stack</property>
|
||||
<property name="title">PicPlanner</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="search_button">
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton" id="location_button">
|
||||
<property name="icon-name">find-location-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="map_button">
|
||||
<property name="icon-name">map-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox" id="box_main">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkSearchBar" id="search_bar">
|
||||
<property name="visible">true</property>
|
||||
<property name="can_focus">true</property>
|
||||
<property name="search-mode-enabled">false</property>
|
||||
<property name="show-close-button">true</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="search_entry">
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="can-focus">true</property>
|
||||
<property name="placeholder-text" translatable="yes">Search... City, Region, Country</property>
|
||||
<signal name="search-changed" handler="search_location"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwClamp">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
|
||||
<child>
|
||||
<object class="AdwExpanderRow">
|
||||
<property name="title" translatable="yes">Coordinates</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">North</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="north_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">north_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">East</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="east_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">east_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="search_results_scroll">
|
||||
<property name="visible">false</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwBin">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin-start">15</property>
|
||||
<property name="margin-end">15</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="margin-bottom">15</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="search_result_box">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwClamp" id="clamp_time_selector">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="AdwPreferencesRow">
|
||||
<property name="title">Date and Time</property>
|
||||
<property name="activatable">false</property>
|
||||
<child>
|
||||
<object class="TimePicker" id="time_picker">
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewStack" id="stack">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="overview_page">
|
||||
<property name="name">page1</property>
|
||||
<property name="title" translatable="yes">Overview</property>
|
||||
<property name="child">overview_box</property>
|
||||
<property name="icon-name">emoji-recent-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="sun_page">
|
||||
<property name="name">page2</property>
|
||||
<property name="title" translatable="yes">Sun</property>
|
||||
<property name="child">sun_box</property>
|
||||
<property name="icon-name">weather-clear-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="moon_page">
|
||||
<property name="name">page3</property>
|
||||
<property name="title" translatable="yes">Moon</property>
|
||||
<property name="child">moon_box</property>
|
||||
<property name="icon-name">weather-clear-night-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="milky_way_page">
|
||||
<property name="name">page4</property>
|
||||
<property name="title" translatable="yes">Milky Way</property>
|
||||
<property name="child">milky_way_box</property>
|
||||
<property name="icon-name">milky-way-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewSwitcherBar">
|
||||
<property name="stack">stack</property>
|
||||
<binding name="reveal">
|
||||
<lookup name="title-visible">switcher_title</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Preferences</attribute>
|
||||
<attribute name="action">app.preferences</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">About PicPlanner</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
|
@ -45,7 +45,6 @@ struct _PicplannerWindow
|
|||
GtkWidget *search_bar; /* Search bar for the location */
|
||||
GtkWidget *search_entry; /* The search entry inside the search bar */
|
||||
GtkWidget *search_button; /* The search button in the header bar so show the search bar */
|
||||
GtkWidget *map_button; /* The map button in the header bar to show the map fullscreen */
|
||||
GtkWidget *location_button; /* Button in the header bar to start the GPS search of the device location */
|
||||
GtkWidget *overview_box; /* The overview page */
|
||||
GtkWidget *sun_box; /* The sun page */
|
||||
|
@ -53,9 +52,8 @@ struct _PicplannerWindow
|
|||
GtkWidget *milky_way_box; /* The milky way page */
|
||||
GtkWidget *north_entry; /* SpinButton for North coordinates */
|
||||
GtkWidget *east_entry; /* SpinButton for East coordinates */
|
||||
GtkWidget *clamp_time_selector;
|
||||
GtkWidget *overview_page;
|
||||
GtkWidget *time_picker;
|
||||
GtkWidget *back_button; /* Go back to the overview page */
|
||||
|
||||
/* Search functionality */
|
||||
GtkWidget *search_result_box; /* ListBox containing search results */
|
||||
|
@ -77,6 +75,61 @@ struct _PicplannerWindow
|
|||
|
||||
G_DEFINE_TYPE (PicplannerWindow, picplanner_window, ADW_TYPE_APPLICATION_WINDOW)
|
||||
|
||||
/*
|
||||
* Change the stack page after a button is pressed in the overview dialog
|
||||
*/
|
||||
static void
|
||||
change_stack_page (GtkWidget *self,
|
||||
int stack_page,
|
||||
gpointer user_data)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window = user_data;
|
||||
if (stack_page == 1)
|
||||
gtk_stack_set_visible_child_name (GTK_STACK(window->stack), "sun");
|
||||
else if (stack_page == 2)
|
||||
gtk_stack_set_visible_child_name (GTK_STACK(window->stack), "moon");
|
||||
else if (stack_page == 3)
|
||||
gtk_stack_set_visible_child_name (GTK_STACK(window->stack), "milkyway");
|
||||
}
|
||||
/*
|
||||
* Go to overview page when back button is pressed
|
||||
*/
|
||||
static void
|
||||
change_stack_page_back (GtkWidget *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
(void) self;
|
||||
PicplannerWindow *window = user_data;
|
||||
gtk_stack_set_visible_child_name (GTK_STACK(window->stack), "overview");
|
||||
}
|
||||
|
||||
/*
|
||||
* Show or hide the buttons in the header bar dependent on the stack page
|
||||
*/
|
||||
static void
|
||||
stack_page_changed (GObject *self,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
(void) self;
|
||||
(void) pspec;
|
||||
PicplannerWindow *window = user_data;
|
||||
|
||||
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK(window->stack)), "overview") == 0)
|
||||
{
|
||||
gtk_widget_set_visible (window->back_button, FALSE);
|
||||
gtk_widget_set_visible (window->search_button, TRUE);
|
||||
gtk_widget_set_visible (window->location_button, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_visible (window->back_button, TRUE);
|
||||
gtk_widget_set_visible (window->search_button, FALSE);
|
||||
gtk_widget_set_visible (window->location_button, FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Function used after the user selects a search result
|
||||
|
@ -152,7 +205,6 @@ search_location (GtkWidget *self,
|
|||
g_autofree char *char_subtitle = NULL;
|
||||
|
||||
gtk_widget_set_visible (window->stack, FALSE);
|
||||
gtk_widget_set_visible (window->clamp_time_selector, FALSE);
|
||||
gtk_widget_set_visible (window->search_results_scroll, TRUE);
|
||||
|
||||
find_loc_children (world, search_string, window->search_result_location, iteration);
|
||||
|
@ -209,26 +261,10 @@ search_location (GtkWidget *self,
|
|||
else
|
||||
{
|
||||
gtk_widget_set_visible (window->stack, TRUE);
|
||||
gtk_widget_set_visible (window->clamp_time_selector, TRUE);
|
||||
gtk_widget_set_visible (window->search_results_scroll, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide the map fullscreen button if the active view is not "page1" (overview)
|
||||
*/
|
||||
static void
|
||||
stack_changed (AdwViewStack *self,
|
||||
gpointer pspec,
|
||||
PicplannerWindow *window)
|
||||
{
|
||||
(void) pspec;
|
||||
if (!strcmp(adw_view_stack_get_visible_child_name (self),"page1"))
|
||||
gtk_widget_set_visible (window->map_button, TRUE);
|
||||
else
|
||||
gtk_widget_set_visible (window->map_button, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
picplanner_set_location (double latitude, double longitude, PicplannerWindow *window)
|
||||
{
|
||||
|
@ -570,13 +606,11 @@ picplanner_window_class_init (PicplannerWindowClass *klass)
|
|||
g_type_ensure (TIME_PICKER_TYPE);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/de/zwarf/picplanner/window/picplanner-window.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, box_main);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, header_bar);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_bar);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, map_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, location_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, overview_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, sun_box);
|
||||
|
@ -586,9 +620,8 @@ picplanner_window_class_init (PicplannerWindowClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, east_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_result_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, search_results_scroll);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, clamp_time_selector);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, overview_page);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, time_picker);
|
||||
gtk_widget_class_bind_template_child (widget_class, PicplannerWindow, back_button);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, search_location);
|
||||
}
|
||||
|
@ -619,10 +652,6 @@ picplanner_window_init (PicplannerWindow *window)
|
|||
window->north_entry, "value",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_settings_bind (window->settings, "map-fullscreen",
|
||||
window->map_button, "active",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_object_bind_property (window->search_button, "active",
|
||||
window->search_bar, "search-mode-enabled",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
|
@ -658,11 +687,6 @@ picplanner_window_init (PicplannerWindow *window)
|
|||
G_CALLBACK (search_location_chosen),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->stack),
|
||||
"notify::visible-child",
|
||||
G_CALLBACK (stack_changed),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->location_button),
|
||||
"clicked",
|
||||
G_CALLBACK (get_user_location),
|
||||
|
@ -673,6 +697,21 @@ picplanner_window_init (PicplannerWindow *window)
|
|||
G_CALLBACK (input_changed),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->overview_box),
|
||||
"change-stack",
|
||||
G_CALLBACK (change_stack_page),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->back_button),
|
||||
"clicked",
|
||||
G_CALLBACK (change_stack_page_back),
|
||||
window);
|
||||
|
||||
g_signal_connect (G_OBJECT (window->stack),
|
||||
"notify::visible-child-name",
|
||||
G_CALLBACK (stack_page_changed),
|
||||
window);
|
||||
|
||||
/*
|
||||
* Initialisation of values needed to detect when a user input ends
|
||||
*/
|
||||
|
@ -680,6 +719,8 @@ picplanner_window_init (PicplannerWindow *window)
|
|||
window->input_count = 0;
|
||||
window->input_timeout_id = 0;
|
||||
|
||||
stack_page_changed (NULL, NULL, window);
|
||||
|
||||
|
||||
/*
|
||||
* Setup the location searchbar to register keyboard input
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
|
||||
<object class="PicplannerOverview" id="overview_box">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
|
@ -32,38 +33,33 @@
|
|||
<template class="PicplannerWindow" parent="AdwApplicationWindow">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
<property name="content">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwHeaderBar" id="header_bar">
|
||||
<property name="centering_policy">strict</property>
|
||||
|
||||
<child type="title">
|
||||
<object class="AdwViewSwitcherTitle" id="switcher_title">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="stack">stack</property>
|
||||
<property name="title">PicPlanner</property>
|
||||
<property name="title-widget">
|
||||
<object class="TimePicker" id="time_picker">
|
||||
</object>
|
||||
</property>
|
||||
<child type="start">
|
||||
<object class="GtkButton" id="back_button">
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="tooltip-text">Overview</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="search_button">
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
<property name="tooltip-text">Search location</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkButton" id="location_button">
|
||||
<property name="icon-name">find-location-symbolic</property>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="map_button">
|
||||
<property name="icon-name">map-symbolic</property>
|
||||
<property name="tooltip-text">Locate position</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
|
@ -72,84 +68,74 @@
|
|||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox" id="box_main">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<object class="GtkSearchBar" id="search_bar">
|
||||
<property name="visible">true</property>
|
||||
<property name="can_focus">true</property>
|
||||
<property name="search-mode-enabled">false</property>
|
||||
<property name="show-close-button">true</property>
|
||||
<child>
|
||||
<object class="GtkSearchBar" id="search_bar">
|
||||
<property name="visible">true</property>
|
||||
<property name="can_focus">true</property>
|
||||
<property name="search-mode-enabled">false</property>
|
||||
<property name="show-close-button">true</property>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="search_entry">
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="can-focus">true</property>
|
||||
<property name="placeholder-text" translatable="yes">Search... City, Region, Country</property>
|
||||
<signal name="search-changed" handler="search_location"/>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkSearchEntry" id="search_entry">
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="can-focus">true</property>
|
||||
<property name="placeholder-text" translatable="yes">Search... City, Region, Country</property>
|
||||
<signal name="search-changed" handler="search_location"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwClamp">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwClamp">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<object class="AdwPreferencesGroup">
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<object class="AdwExpanderRow">
|
||||
<property name="title" translatable="yes">Coordinates</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwExpanderRow">
|
||||
<property name="title" translatable="yes">Coordinates</property>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">North</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="north_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">north_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">North</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="north_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">north_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">East</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="east_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">east_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">East</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="east_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="adjustment">east_adjustment</property>
|
||||
<property name="numeric">false</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="digits">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
@ -157,126 +143,89 @@
|
|||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="search_results_scroll">
|
||||
<property name="visible">false</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwBin">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin-start">15</property>
|
||||
<property name="margin-end">15</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="margin-bottom">15</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="search_result_box">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwClamp" id="clamp_time_selector">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="AdwPreferencesRow">
|
||||
<property name="title">Date and Time</property>
|
||||
<property name="activatable">false</property>
|
||||
<child>
|
||||
<object class="TimePicker" id="time_picker">
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewStack" id="stack">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="overview_page">
|
||||
<property name="name">page1</property>
|
||||
<property name="title" translatable="yes">Overview</property>
|
||||
<property name="child">overview_box</property>
|
||||
<property name="icon-name">emoji-recent-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="sun_page">
|
||||
<property name="name">page2</property>
|
||||
<property name="title" translatable="yes">Sun</property>
|
||||
<property name="child">sun_box</property>
|
||||
<property name="icon-name">weather-clear-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="moon_page">
|
||||
<property name="name">page3</property>
|
||||
<property name="title" translatable="yes">Moon</property>
|
||||
<property name="child">moon_box</property>
|
||||
<property name="icon-name">weather-clear-night-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage" id="milky_way_page">
|
||||
<property name="name">page4</property>
|
||||
<property name="title" translatable="yes">Milky Way</property>
|
||||
<property name="child">milky_way_box</property>
|
||||
<property name="icon-name">milky-way-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwViewSwitcherBar">
|
||||
<property name="stack">stack</property>
|
||||
<binding name="reveal">
|
||||
<lookup name="title-visible">switcher_title</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="search_results_scroll">
|
||||
<property name="visible">false</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwBin">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin-start">15</property>
|
||||
<property name="margin-end">15</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="margin-bottom">15</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="search_result_box">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="valign">fill</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="width-request">360</property>
|
||||
<child>
|
||||
<object class="GtkStackPage" id="overview_page">
|
||||
<property name="name">overview</property>
|
||||
<property name="title" translatable="yes">Overview</property>
|
||||
<property name="icon-name">emoji-recent-symbolic</property>
|
||||
<property name="child">overview_box</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage" id="sun_page">
|
||||
<property name="name">sun</property>
|
||||
<property name="title" translatable="yes">Sun</property>
|
||||
<property name="icon-name">weather-clear-symbolic</property>
|
||||
<property name="child">sun_box</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage" id="moon_page">
|
||||
<property name="name">moon</property>
|
||||
<property name="title" translatable="yes">Moon</property>
|
||||
<property name="icon-name">weather-clear-night-symbolic</property>
|
||||
<property name="child">moon_box</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage" id="milky_way_page">
|
||||
<property name="name">milkyway</property>
|
||||
<property name="title" translatable="yes">Milky Way</property>
|
||||
<property name="icon-name">milky-way-symbolic</property>
|
||||
<property name="child">milky_way_box</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</property>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
<menu id="primary_menu">
|
||||
|
|
Ładowanie…
Reference in New Issue