year-view: initial commit
Dropped almost everything. Started using an ui file and using a GtkBox as a parent.
This commit is contained in:
@@ -40,6 +40,7 @@ EXTRA_DIST= \
|
||||
ui/search-view.ui \
|
||||
ui/time-selector.ui \
|
||||
ui/window.ui \
|
||||
ui/year-view.ui \
|
||||
theme/gtk-styles.css \
|
||||
$(desktop_in_files) \
|
||||
$(gsettingsschema_in_files)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<file alias="search-view.ui" compressed="true" preprocess="xml-stripblanks">ui/search-view.ui</file>
|
||||
<file alias="time-selector.ui" compressed="true" preprocess="xml-stripblanks">ui/time-selector.ui</file>
|
||||
<file alias="window.ui" compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
|
||||
<file alias="year-view.ui" compressed="true" preprocess="xml-stripblanks">ui/year-view.ui</file>
|
||||
<file alias="gtk-styles.css" compressed="true">theme/gtk-styles.css</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.10 -->
|
||||
<template class="GcalYearView" parent="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkDrawingArea" id="year_view_navigator">
|
||||
<property name="visible">True</property>
|
||||
<signal name="draw" handler="draw_navigator" object="GcalYearView" swapped="yes" />
|
||||
<!-- FIXME: add some other necessary signals -->
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkOverlay" id="sidebar">
|
||||
<property name="visible">True</property>
|
||||
<child type="overlay">
|
||||
<object class="GtkButton" id="add_event_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="label" translatable="yes">Add new event...</property>
|
||||
<signal name="clicked" handler="add_event_clicked_cb" object="GcalYearView" swapped="yes" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="events_listbox">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
||||
+3
-5
@@ -1294,11 +1294,9 @@ gcal_window_constructed (GObject *object)
|
||||
gcal_month_view_set_use_24h_format (GCAL_MONTH_VIEW (priv->views[GCAL_WINDOW_VIEW_MONTH]), use_24h_format);
|
||||
gtk_stack_add_titled (GTK_STACK (priv->views_stack), priv->views[GCAL_WINDOW_VIEW_MONTH], "month", _("Month"));
|
||||
|
||||
priv->views[GCAL_WINDOW_VIEW_YEAR] =
|
||||
gcal_year_view_new (priv->manager);
|
||||
gtk_stack_add_titled (GTK_STACK (priv->views_stack),
|
||||
priv->views[GCAL_WINDOW_VIEW_YEAR],
|
||||
"year", _("Year"));
|
||||
priv->views[GCAL_WINDOW_VIEW_YEAR] = GTK_WIDGET (gcal_year_view_new ());
|
||||
gcal_year_view_set_manager (GCAL_YEAR_VIEW (priv->views[GCAL_WINDOW_VIEW_YEAR]), priv->manager);
|
||||
gtk_stack_add_titled (GTK_STACK (priv->views_stack), priv->views[GCAL_WINDOW_VIEW_YEAR], "year", _("Year"));
|
||||
|
||||
/* search view */
|
||||
gcal_search_view_connect (GCAL_SEARCH_VIEW (priv->search_view), priv->manager);
|
||||
|
||||
+139
-932
File diff suppressed because it is too large
Load Diff
+27
-23
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* gcal-year-view.h
|
||||
/* gcal-year-view.h
|
||||
*
|
||||
* Copyright (C) 2012 - Erick Pérez Castellanos
|
||||
* Copyright (C) 2015 Erick Pérez Castellanos <erick.red@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* 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 2 of the License, or
|
||||
* 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,
|
||||
@@ -17,39 +16,44 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GCAL_YEAR_VIEW_H__
|
||||
#define __GCAL_YEAR_VIEW_H__
|
||||
#ifndef GCAL_YEAR_VIEW_H
|
||||
#define GCAL_YEAR_VIEW_H
|
||||
|
||||
#include "gcal-manager.h"
|
||||
|
||||
#include "gcal-subscriber-view.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GCAL_TYPE_YEAR_VIEW (gcal_year_view_get_type ())
|
||||
#define GCAL_YEAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCAL_TYPE_YEAR_VIEW, GcalYearView))
|
||||
#define GCAL_YEAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCAL_TYPE_YEAR_VIEW, GcalYearViewClass))
|
||||
#define GCAL_IS_YEAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCAL_TYPE_YEAR_VIEW))
|
||||
#define GCAL_IS_YEAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCAL_TYPE_YEAR_VIEW))
|
||||
#define GCAL_YEAR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCAL_TYPE_YEAR_VIEW, GcalYearViewClass))
|
||||
#define GCAL_TYPE_YEAR_VIEW (gcal_year_view_get_type())
|
||||
#define GCAL_YEAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCAL_TYPE_YEAR_VIEW, GcalYearView))
|
||||
#define GCAL_YEAR_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCAL_TYPE_YEAR_VIEW, GcalYearView const))
|
||||
#define GCAL_YEAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCAL_TYPE_YEAR_VIEW, GcalYearViewClass))
|
||||
#define GCAL_IS_YEAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCAL_TYPE_YEAR_VIEW))
|
||||
#define GCAL_IS_YEAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCAL_TYPE_YEAR_VIEW))
|
||||
#define GCAL_YEAR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCAL_TYPE_YEAR_VIEW, GcalYearViewClass))
|
||||
|
||||
typedef struct _GcalYearView GcalYearView;
|
||||
typedef struct _GcalYearViewClass GcalYearViewClass;
|
||||
typedef struct _GcalYearView GcalYearView;
|
||||
typedef struct _GcalYearViewClass GcalYearViewClass;
|
||||
typedef struct _GcalYearViewPrivate GcalYearViewPrivate;
|
||||
|
||||
struct _GcalYearView
|
||||
{
|
||||
GcalSubscriberView parent;
|
||||
GtkBox parent;
|
||||
|
||||
/*< private >*/
|
||||
GcalYearViewPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GcalYearViewClass
|
||||
{
|
||||
GcalSubscriberViewClass parent_class;
|
||||
GtkBoxClass parent;
|
||||
};
|
||||
|
||||
GType gcal_year_view_get_type (void);
|
||||
|
||||
GtkWidget* gcal_year_view_new (GcalManager *manager);
|
||||
|
||||
GType gcal_year_view_get_type (void);
|
||||
GcalYearView *gcal_year_view_new (void);
|
||||
void gcal_year_view_set_manager (GcalYearView *year_view,
|
||||
GcalManager *manager);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GCAL_YEAR_VIEW_H__ */
|
||||
#endif /* GCAL_YEAR_VIEW_H */
|
||||
|
||||
Reference in New Issue
Block a user