Merge pull request #24 from gergelypolonkai/aspect-table
Add character symbols for aspects and planets (with options to turn it on/off)
This commit is contained in:
commit
d6fdffb01e
@ -1,6 +1,16 @@
|
||||
<schemalist gettext-domain="astrognome">
|
||||
<schema id="eu.polonkai.gergely.Astrognome" path="/eu/polonkai/gergely/Astrognome/">
|
||||
<child name="state" schema="eu.polonkai.gergely.Astrognome.state" />
|
||||
<key name="planets-char" type="b">
|
||||
<default>false</default>
|
||||
<summary>Display planet symbols as UTF-8 characters</summary>
|
||||
<description>Whether to show planet symbols as their UTF-8 representation. Uses less memory, but not all system fonts have them defined. If a planet (like most dwarves) don’t have a character representation, an image fallback will be used.</description>
|
||||
</key>
|
||||
<key name="aspects-char" type="b">
|
||||
<default>false</default>
|
||||
<summary>Display aspect symbols as UTF-8 characters</summary>
|
||||
<description>Whether to show aspect symbols as their UTF-8 representation. Uses less memory, but not all system fonts have them defined. If an aspect don’t have a character representation, an image fallback will be used.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="eu.polonkai.gergely.Astrognome.state" path="/eu/polonkai/gergely/Astrognome/state/">
|
||||
<child name="window" schema="eu.polonkai.gergely.Astrognome.state.window" />
|
||||
|
@ -1,10 +1,11 @@
|
||||
resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/ag.gresource.xml)
|
||||
RESOURCE_DIR = $(srcdir)/resources
|
||||
resource_files = $(shell glib-compile-resources --sourcedir=$(RESOURCE_DIR) --generate-dependencies $(srcdir)/ag.gresource.xml)
|
||||
|
||||
ag-resources.c: ag.gresource.xml $(resource_files)
|
||||
glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name ag $(srcdir)/ag.gresource.xml
|
||||
glib-compile-resources --target=$@ --sourcedir=$(RESOURCE_DIR) --generate-source --c-name ag $(srcdir)/ag.gresource.xml
|
||||
|
||||
ag-resources.h: ag.gresource.xml $(resource_files)
|
||||
glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name ag $(srcdir)/ag.gresource.xml
|
||||
glib-compile-resources --target=$@ --sourcedir=$(RESOURCE_DIR) --generate-header --c-name ag $(srcdir)/ag.gresource.xml
|
||||
|
||||
BUILT_SOURCES = \
|
||||
ag-resources.h \
|
||||
@ -33,7 +34,3 @@ astrognome_LDADD = $(SWE_GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(LIBXSLT_LIBS) $
|
||||
astrognome_LDFLAGS = -rdynamic
|
||||
astrognome_CFLAGS = $(SWE_GLIB_CFLAGS) $(CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS) $(WEBKIT_CFLAGS) -Wall
|
||||
|
||||
guidir = $(pkgdatadir)
|
||||
gui_DATA = astrognome.ui
|
||||
|
||||
EXTRA_DIST += $(gui_DATA)
|
||||
|
@ -257,7 +257,7 @@ setup_menu(AgApp *app)
|
||||
|
||||
builder = gtk_builder_new();
|
||||
|
||||
if (!gtk_builder_add_from_resource(builder, "/eu/polonkai/gergely/astrognome/astrognome.ui", &err)) {
|
||||
if (!gtk_builder_add_from_resource(builder, "/eu/polonkai/gergely/Astrognome/ui/astrognome.ui", &err)) {
|
||||
g_error("%s", (err) ? err->message : "unknown error");
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,9 @@ static GtkWidget *prefs_dialog = NULL;
|
||||
|
||||
typedef struct _AgPreferencesPrivate {
|
||||
GtkCheckButton *maximized;
|
||||
GtkCheckButton *planet_chars;
|
||||
GtkCheckButton *aspect_chars;
|
||||
|
||||
AgSettings *settings;
|
||||
} AgPreferencesPrivate;
|
||||
|
||||
@ -40,15 +43,18 @@ ag_preferences_class_init(AgPreferencesClass *klass)
|
||||
object_class->finalize = ag_preferences_finalize;
|
||||
dialog_class->response = ag_preferences_response;
|
||||
|
||||
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/astrognome/ag-preferences.ui");
|
||||
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/Astrognome/ui/ag-preferences.ui");
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgPreferences, maximized);
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgPreferences, planet_chars);
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgPreferences, aspect_chars);
|
||||
}
|
||||
|
||||
static void
|
||||
ag_preferences_init(AgPreferences *prefs)
|
||||
{
|
||||
AgPreferencesPrivate *priv;
|
||||
GSettings *settings_window;
|
||||
GSettings *settings_window,
|
||||
*settings_main;
|
||||
|
||||
priv = ag_preferences_get_instance_private(prefs);
|
||||
gtk_widget_init_template(GTK_WIDGET(prefs));
|
||||
@ -57,6 +63,10 @@ ag_preferences_init(AgPreferences *prefs)
|
||||
|
||||
settings_window = ag_settings_peek_window_settings(priv->settings);
|
||||
g_settings_bind(settings_window, "maximized", priv->maximized, "active", G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
settings_main = ag_settings_peek_main_settings(priv->settings);
|
||||
g_settings_bind(settings_main, "planets-char", priv->planet_chars, "active", G_SETTINGS_BIND_DEFAULT);
|
||||
g_settings_bind(settings_main, "aspects-char", priv->aspect_chars, "active", G_SETTINGS_BIND_DEFAULT);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,11 +1,13 @@
|
||||
#include "ag-settings.h"
|
||||
|
||||
#define SETTINGS_SCHEMA_ID_MAIN "eu.polonkai.gergely.Astrognome"
|
||||
#define SETTINGS_SCHEMA_ID_WINDOW "eu.polonkai.gergely.Astrognome.state.window"
|
||||
#define SETTINGS_SCHEMA_ID_CHART "eu.polonkai.gergely.Astrognome.state.chart"
|
||||
|
||||
static AgSettings *singleton = NULL;
|
||||
|
||||
struct _AgSettingsPrivate {
|
||||
GSettings *settings_main;
|
||||
GSettings *settings_window;
|
||||
GSettings *settings_chart;
|
||||
};
|
||||
@ -17,6 +19,7 @@ ag_settings_init(AgSettings *settings)
|
||||
{
|
||||
AgSettingsPrivate *priv = ag_settings_get_instance_private(settings);
|
||||
|
||||
priv->settings_main = g_settings_new(SETTINGS_SCHEMA_ID_MAIN);
|
||||
priv->settings_window = g_settings_new(SETTINGS_SCHEMA_ID_WINDOW);
|
||||
priv->settings_chart = g_settings_new(SETTINGS_SCHEMA_ID_CHART);
|
||||
}
|
||||
@ -28,6 +31,7 @@ ag_settings_dispose(GObject *object)
|
||||
|
||||
g_clear_object(&priv->settings_window);
|
||||
g_clear_object(&priv->settings_chart);
|
||||
g_clear_object(&priv->settings_main);
|
||||
|
||||
G_OBJECT_CLASS(ag_settings_parent_class)->dispose(object);
|
||||
}
|
||||
@ -63,6 +67,14 @@ ag_settings_get(void)
|
||||
return singleton;
|
||||
}
|
||||
|
||||
GSettings *
|
||||
ag_settings_peek_main_settings(AgSettings *settings)
|
||||
{
|
||||
AgSettingsPrivate *priv = ag_settings_get_instance_private(settings);
|
||||
|
||||
return priv->settings_main;
|
||||
}
|
||||
|
||||
GSettings *
|
||||
ag_settings_peek_window_settings(AgSettings *settings)
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ GType ag_settings_get_type(void);
|
||||
|
||||
AgSettings *ag_settings_get(void);
|
||||
|
||||
GSettings *ag_settings_peek_main_settings(AgSettings *settings);
|
||||
GSettings *ag_settings_peek_window_settings(AgSettings *settings);
|
||||
GSettings *ag_settings_peek_chart_settings(AgSettings *settings);
|
||||
|
||||
|
324
src/ag-window.c
324
src/ag-window.c
@ -256,14 +256,244 @@ ag_window_export_svg_action(GSimpleAction *action, GVariant *parameter, gpointer
|
||||
// TODO: Check err!
|
||||
}
|
||||
|
||||
const gchar *
|
||||
ag_window_planet_character(GswePlanet planet)
|
||||
{
|
||||
switch (planet) {
|
||||
case GSWE_PLANET_ASCENDANT:
|
||||
return "AC";
|
||||
|
||||
case GSWE_PLANET_MC:
|
||||
return "MC";
|
||||
|
||||
case GSWE_PLANET_VERTEX:
|
||||
return "Vx";
|
||||
|
||||
case GSWE_PLANET_SUN:
|
||||
return "☉";
|
||||
|
||||
case GSWE_PLANET_MOON:
|
||||
return "☽";
|
||||
|
||||
case GSWE_PLANET_MOON_NODE:
|
||||
return "☊";
|
||||
|
||||
case GSWE_PLANET_MERCURY:
|
||||
return "☿";
|
||||
|
||||
case GSWE_PLANET_VENUS:
|
||||
return "♀";
|
||||
|
||||
case GSWE_PLANET_MARS:
|
||||
return "♂";
|
||||
|
||||
case GSWE_PLANET_JUPITER:
|
||||
return "♃";
|
||||
|
||||
case GSWE_PLANET_SATURN:
|
||||
return "♄";
|
||||
|
||||
case GSWE_PLANET_URANUS:
|
||||
return "♅";
|
||||
|
||||
case GSWE_PLANET_NEPTUNE:
|
||||
return "♆";
|
||||
|
||||
case GSWE_PLANET_PLUTO:
|
||||
return "♇";
|
||||
|
||||
case GSWE_PLANET_CERES:
|
||||
return "⚳";
|
||||
|
||||
case GSWE_PLANET_PALLAS:
|
||||
return "⚴";
|
||||
|
||||
case GSWE_PLANET_JUNO:
|
||||
return "⚵";
|
||||
|
||||
case GSWE_PLANET_VESTA:
|
||||
return "⚶";
|
||||
|
||||
case GSWE_PLANET_CHIRON:
|
||||
return "⚷";
|
||||
|
||||
case GSWE_PLANET_MOON_APOGEE:
|
||||
return "⚸";
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ag_window_create_planet_widget(GswePlanetInfo *planet_info)
|
||||
{
|
||||
const gchar *planet_char;
|
||||
GswePlanet planet = gswe_planet_info_get_planet(planet_info);
|
||||
GSettings *settings = ag_settings_peek_main_settings(ag_settings_get());
|
||||
|
||||
if (
|
||||
((planet_char = ag_window_planet_character(planet)) != NULL)
|
||||
&& (g_settings_get_boolean(settings, "planets-char"))
|
||||
)
|
||||
{
|
||||
return gtk_label_new(planet_char);
|
||||
}
|
||||
|
||||
switch (planet) {
|
||||
case GSWE_PLANET_SUN:
|
||||
return gtk_image_new_from_resource("/eu/polonkai/gergely/Astrognome/default-icons/planet-sun.svg");
|
||||
|
||||
default:
|
||||
return gtk_label_new(gswe_planet_info_get_name(planet_info));
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
ag_window_aspect_character(GsweAspect aspect)
|
||||
{
|
||||
switch (aspect) {
|
||||
case GSWE_ASPECT_CONJUCTION:
|
||||
return "☌";
|
||||
|
||||
case GSWE_ASPECT_OPPOSITION:
|
||||
return "☍";
|
||||
|
||||
case GSWE_ASPECT_QUINTILE:
|
||||
return "Q";
|
||||
|
||||
case GSWE_ASPECT_BIQUINTILE:
|
||||
return "BQ";
|
||||
|
||||
case GSWE_ASPECT_SQUARE:
|
||||
return "◽";
|
||||
|
||||
case GSWE_ASPECT_TRINE:
|
||||
return "▵";
|
||||
|
||||
case GSWE_ASPECT_SEXTILE:
|
||||
return "⚹";
|
||||
|
||||
case GSWE_ASPECT_SEMISEXTILE:
|
||||
return "⚺";
|
||||
|
||||
case GSWE_ASPECT_QUINCUNX:
|
||||
return "⚻";
|
||||
|
||||
case GSWE_ASPECT_SESQUISQUARE:
|
||||
return "⚼";
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
ag_window_create_aspect_widget(GsweAspectInfo *aspect_info)
|
||||
{
|
||||
const gchar *aspect_char;
|
||||
GsweAspect aspect = gswe_aspect_info_get_aspect(aspect_info);
|
||||
GSettings *settings = ag_settings_peek_main_settings(ag_settings_get());
|
||||
|
||||
if (
|
||||
((aspect_char = ag_window_aspect_character(aspect)) != NULL)
|
||||
&& (g_settings_get_boolean(settings, "aspects-char"))
|
||||
)
|
||||
{
|
||||
return gtk_label_new(aspect_char);
|
||||
}
|
||||
|
||||
switch (aspect) {
|
||||
default:
|
||||
return gtk_label_new(gswe_aspect_info_get_name(aspect_info));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ag_window_redraw_chart(AgWindow *window)
|
||||
ag_window_redraw_aspect_table(AgWindow *window)
|
||||
{
|
||||
GList *planet_list,
|
||||
*planet1,
|
||||
*planet2;
|
||||
guint i,
|
||||
j;
|
||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||
|
||||
planet_list = ag_chart_get_planets(priv->chart);
|
||||
|
||||
if (priv->aspect_table_populated == FALSE) {
|
||||
GList *planet;
|
||||
guint i;
|
||||
|
||||
for (planet = planet_list, i = 0; planet; planet = g_list_next(planet), i++) {
|
||||
GtkWidget *label_hor,
|
||||
*label_ver,
|
||||
*current_widget;
|
||||
GswePlanet planet_id;
|
||||
GswePlanetData *planet_data;
|
||||
GswePlanetInfo *planet_info;
|
||||
|
||||
planet_id = GPOINTER_TO_INT(planet->data);
|
||||
planet_data = gswe_moment_get_planet(GSWE_MOMENT(priv->chart), planet_id, NULL);
|
||||
planet_info = gswe_planet_data_get_planet_info(planet_data);
|
||||
|
||||
if ((current_widget = gtk_grid_get_child_at(GTK_GRID(priv->aspect_table), i + 1, i)) != NULL) {
|
||||
gtk_container_remove(GTK_CONTAINER(priv->aspect_table), current_widget);
|
||||
}
|
||||
|
||||
label_hor = ag_window_create_planet_widget(planet_info);
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), label_hor, i + 1, i, 1, 1);
|
||||
|
||||
if (i > 0) {
|
||||
if ((current_widget = gtk_grid_get_child_at(GTK_GRID(priv->aspect_table), 0, i)) != NULL) {
|
||||
gtk_container_remove(GTK_CONTAINER(priv->aspect_table), current_widget);
|
||||
}
|
||||
|
||||
label_ver = ag_window_create_planet_widget(planet_info);
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), label_ver, 0, i, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
priv->aspect_table_populated = TRUE;
|
||||
}
|
||||
|
||||
for (planet1 = planet_list, i = 0; planet1; planet1 = g_list_next(planet1), i++) {
|
||||
for (planet2 = planet_list, j = 0; planet2; planet2 = g_list_next(planet2), j++) {
|
||||
GsweAspectData *aspect;
|
||||
GtkWidget *aspect_widget;
|
||||
GError *err = NULL;
|
||||
|
||||
if (GPOINTER_TO_INT(planet1->data) == GPOINTER_TO_INT(planet2->data)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((aspect_widget = gtk_grid_get_child_at(GTK_GRID(priv->aspect_table), j + 1, i)) != NULL) {
|
||||
gtk_container_remove(GTK_CONTAINER(priv->aspect_table), aspect_widget);
|
||||
}
|
||||
|
||||
if ((aspect = gswe_moment_get_aspect_by_planets(GSWE_MOMENT(priv->chart), GPOINTER_TO_INT(planet1->data), GPOINTER_TO_INT(planet2->data), &err)) != NULL) {
|
||||
GsweAspectInfo *aspect_info;
|
||||
|
||||
aspect_info = gswe_aspect_data_get_aspect_info(aspect);
|
||||
|
||||
if (gswe_aspect_data_get_aspect(aspect) != GSWE_ASPECT_NONE) {
|
||||
aspect_widget = ag_window_create_aspect_widget(aspect_info);
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), aspect_widget, j + 1, i, 1, 1);
|
||||
}
|
||||
} else if (err) {
|
||||
g_warning("%s\n", err->message);
|
||||
} else {
|
||||
g_error("No aspect is returned between two planets. This is a bug in SWE-GLib!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_show_all(priv->aspect_table);
|
||||
}
|
||||
|
||||
void
|
||||
ag_window_redraw_chart(AgWindow *window)
|
||||
{
|
||||
GError *err = NULL;
|
||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||
gchar *svg_content = ag_chart_create_svg(priv->chart, NULL, &err);
|
||||
@ -281,72 +511,7 @@ ag_window_redraw_chart(AgWindow *window)
|
||||
g_free(svg_content);
|
||||
}
|
||||
|
||||
planet_list = ag_chart_get_planets(priv->chart);
|
||||
|
||||
if (priv->aspect_table_populated == FALSE) {
|
||||
GList *planet;
|
||||
guint i;
|
||||
|
||||
for (planet = planet_list, i = 0; planet; planet = g_list_next(planet), i++) {
|
||||
GtkWidget *label_hor,
|
||||
*label_ver;
|
||||
GswePlanet planet_id;
|
||||
GswePlanetData *planet_data;
|
||||
GswePlanetInfo *planet_info;
|
||||
|
||||
planet_id = GPOINTER_TO_INT(planet->data);
|
||||
planet_data = gswe_moment_get_planet(GSWE_MOMENT(priv->chart), planet_id, NULL);
|
||||
planet_info = gswe_planet_data_get_planet_info(planet_data);
|
||||
|
||||
label_hor = gtk_label_new(gswe_planet_info_get_name(planet_info));
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), label_hor, i + 1, i, 1, 1);
|
||||
|
||||
if (i > 0) {
|
||||
label_ver = gtk_label_new(gswe_planet_info_get_name(planet_info));
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), label_ver, 0, i, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
priv->aspect_table_populated = TRUE;
|
||||
}
|
||||
|
||||
for (planet1 = planet_list, i = 0; planet1; planet1 = g_list_next(planet1), i++) {
|
||||
for (planet2 = planet_list, j = 0; planet2; planet2 = g_list_next(planet2), j++) {
|
||||
GsweAspectData *aspect;
|
||||
GError *err = NULL;
|
||||
|
||||
if (GPOINTER_TO_INT(planet1->data) == GPOINTER_TO_INT(planet2->data)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((aspect = gswe_moment_get_aspect_by_planets(GSWE_MOMENT(priv->chart), GPOINTER_TO_INT(planet1->data), GPOINTER_TO_INT(planet2->data), &err)) != NULL) {
|
||||
GsweAspectInfo *aspect_info;
|
||||
GtkWidget *aspect_label;
|
||||
|
||||
aspect_info = gswe_aspect_data_get_aspect_info(aspect);
|
||||
aspect_label = gtk_grid_get_child_at(GTK_GRID(priv->aspect_table), j + 1, i);
|
||||
|
||||
if (gswe_aspect_data_get_aspect(aspect) == GSWE_ASPECT_NONE) {
|
||||
if (aspect_label != NULL) {
|
||||
gtk_container_remove(GTK_CONTAINER(priv->aspect_table), aspect_label);
|
||||
}
|
||||
} else {
|
||||
if (aspect_label == NULL) {
|
||||
aspect_label = gtk_label_new(gswe_aspect_info_get_name(aspect_info));
|
||||
gtk_grid_attach(GTK_GRID(priv->aspect_table), aspect_label, j + 1, i, 1, 1);
|
||||
} else {
|
||||
gtk_label_set_label(GTK_LABEL(aspect_label), gswe_aspect_info_get_name(aspect_info));
|
||||
}
|
||||
}
|
||||
} else if (err) {
|
||||
g_warning("%s\n", err->message);
|
||||
} else {
|
||||
g_error("No aspect is returned between two planets. This is a bug in SWE-GLib!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_show_all(priv->aspect_table);
|
||||
ag_window_redraw_aspect_table(window);
|
||||
}
|
||||
|
||||
void
|
||||
@ -482,15 +647,34 @@ static GActionEntry win_entries[] = {
|
||||
{ "change-tab", ag_window_change_tab_action, "s", "'edit'", NULL },
|
||||
};
|
||||
|
||||
static void
|
||||
ag_window_display_changed(GSettings *settings, gchar *key, AgWindow *window)
|
||||
{
|
||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||
|
||||
/* The planet symbols are redrawn only if aspect_table_populated is
|
||||
* set to FALSE */
|
||||
if (g_str_equal("planets-char", key)) {
|
||||
priv->aspect_table_populated = FALSE;
|
||||
}
|
||||
|
||||
ag_window_redraw_aspect_table(window);
|
||||
}
|
||||
|
||||
static void
|
||||
ag_window_init(AgWindow *window)
|
||||
{
|
||||
AgWindowPrivate *priv;
|
||||
GtkAccelGroup *accel_group;
|
||||
GSettings *main_settings;
|
||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||
|
||||
gtk_widget_init_template(GTK_WIDGET(window));
|
||||
|
||||
priv = ag_window_get_instance_private(window);
|
||||
priv->settings = ag_settings_get();
|
||||
main_settings = ag_settings_peek_main_settings(priv->settings);
|
||||
|
||||
g_signal_connect(G_OBJECT(main_settings), "changed::planets-char", G_CALLBACK(ag_window_display_changed), window);
|
||||
g_signal_connect(G_OBJECT(main_settings), "changed::aspects-char", G_CALLBACK(ag_window_display_changed), window);
|
||||
|
||||
webkit_web_view_load_string(
|
||||
WEBKIT_WEB_VIEW(priv->chart_web_view),
|
||||
@ -540,7 +724,7 @@ ag_window_class_init(AgWindowClass *klass)
|
||||
|
||||
gobject_class->dispose = ag_window_dispose;
|
||||
|
||||
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/astrognome/ag-window.ui");
|
||||
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/Astrognome/ui/ag-window.ui");
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgWindow, header_bar);
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgWindow, name);
|
||||
gtk_widget_class_bind_template_child_private(widget_class, AgWindow, year);
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/eu/polonkai/gergely/astrognome">
|
||||
<file>astrognome.ui</file>
|
||||
<file>ag-window.ui</file>
|
||||
<file>ag-preferences.ui</file>
|
||||
<gresource prefix="/eu/polonkai/gergely/Astrognome">
|
||||
<file>ui/astrognome.ui</file>
|
||||
<file>ui/ag-window.ui</file>
|
||||
<file>ui/ag-preferences.ui</file>
|
||||
|
||||
<file>default-icons/planet-sun.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
69
src/resources/default-icons/planet-sun.svg
Normal file
69
src/resources/default-icons/planet-sun.svg
Normal file
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="29.21875"
|
||||
height="29.21875"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
version="1.0"
|
||||
sodipodi:docname="planet_sun.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.979899"
|
||||
inkscape:cx="196.94243"
|
||||
inkscape:cy="-23.0998"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1021"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-268.70513,-375.63652)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="planet_sun"
|
||||
style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell"
|
||||
d="m 297.92388,390.2459 c -4e-5,4.04949 -1.42582,7.5 -4.27735,10.35156 -2.85158,2.83854 -6.3021,4.25781 -10.35156,4.25781 -4.02345,0 -7.46095,-1.41927 -10.3125,-4.25781 -2.85157,-2.85156 -4.27735,-6.30207 -4.27734,-10.35156 -10e-6,-2.52603 0.65103,-4.96092 1.95312,-7.30469 1.3151,-2.35675 3.14452,-4.16013 5.48828,-5.41016 2.34374,-1.26299 4.72655,-1.8945 7.14844,-1.89453 2.46092,3e-5 4.86326,0.63154 7.20703,1.89453 2.34372,1.25003 4.16664,3.0469 5.46875,5.39063 1.30205,2.33075 1.95309,4.77215 1.95313,7.32422 m -27.79297,0 c -10e-6,3.64584 1.28254,6.75131 3.84765,9.3164 2.5651,2.55209 5.67056,3.82813 9.31641,3.82813 3.64581,0 6.75128,-1.27604 9.31641,-3.82813 2.56507,-2.56509 3.84762,-5.67056 3.84765,-9.3164 -3e-5,-2.30467 -0.58597,-4.50519 -1.75781,-6.60157 -1.1719,-2.09633 -2.81253,-3.71091 -4.92187,-4.84375 -2.1094,-1.13278 -4.27086,-1.69919 -6.48438,-1.69922 -2.21356,3e-5 -4.37501,0.56644 -6.48437,1.69922 -2.10939,1.13284 -3.75001,2.74742 -4.92188,4.84375 -1.17188,2.09638 -1.75782,4.2969 -1.75781,6.60157 m 16.83594,0 c -3e-5,1.01564 -0.3581,1.88152 -1.07422,2.59765 -0.70315,0.70314 -1.56252,1.0547 -2.57813,1.05469 -1.00262,1e-5 -1.86199,-0.35155 -2.57812,-1.05469 -0.71616,-0.71613 -1.07424,-1.58201 -1.07422,-2.59765 -2e-5,-0.63801 0.16274,-1.24999 0.48828,-1.83594 0.32551,-0.58592 0.78123,-1.03514 1.36719,-1.34766 0.58592,-0.31248 1.18488,-0.46873 1.79687,-0.46875 0.61196,2e-5 1.21092,0.15627 1.79688,0.46875 0.58591,0.31252 1.04164,0.76174 1.36718,1.34766 0.3255,0.58595 0.48826,1.19793 0.48829,1.83594" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.6 KiB |
@ -46,6 +46,34 @@
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="planet_chars">
|
||||
<property name="label" translatable="yes">Use UTF-8 characters for planet symbols</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="aspect_chars">
|
||||
<property name="label" translatable="yes">Use UTF-8 characters for aspect symbols</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
Loading…
Reference in New Issue
Block a user