event-editor/multi-choice: Properly space out code
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/603>
This commit is contained in:
@@ -24,25 +24,29 @@
|
|||||||
|
|
||||||
struct _GcalMultiChoice
|
struct _GcalMultiChoice
|
||||||
{
|
{
|
||||||
GtkBox parent;
|
GtkBox parent;
|
||||||
GtkWidget *down_button;
|
|
||||||
GtkWidget *button;
|
GtkWidget *down_button;
|
||||||
GtkStack *stack;
|
GtkWidget *button;
|
||||||
GtkWidget *up_button;
|
GtkStack *stack;
|
||||||
gint value;
|
GtkWidget *up_button;
|
||||||
gint min_value;
|
GtkWidget *label1;
|
||||||
gint max_value;
|
GtkWidget *label2;
|
||||||
gboolean wrap;
|
|
||||||
gboolean animate;
|
gint value;
|
||||||
GtkWidget **choices;
|
gint min_value;
|
||||||
gint n_choices;
|
gint max_value;
|
||||||
GtkWidget *active;
|
gboolean wrap;
|
||||||
GtkWidget *label1;
|
gboolean animate;
|
||||||
GtkWidget *label2;
|
|
||||||
GtkWidget *popover;
|
GtkWidget **choices;
|
||||||
GcalMultiChoiceFormatCallback format_cb;
|
gint n_choices;
|
||||||
gpointer format_data;
|
GtkWidget *active;
|
||||||
GDestroyNotify format_destroy;
|
GtkWidget *popover;
|
||||||
|
|
||||||
|
GcalMultiChoiceFormatCallback format_cb;
|
||||||
|
gpointer format_data;
|
||||||
|
GDestroyNotify format_destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -75,7 +79,7 @@ G_DEFINE_TYPE (GcalMultiChoice, gcal_multi_choice, GTK_TYPE_BOX)
|
|||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
get_value_string (GcalMultiChoice *self,
|
get_value_string (GcalMultiChoice *self,
|
||||||
gint value)
|
gint value)
|
||||||
{
|
{
|
||||||
if (self->format_cb)
|
if (self->format_cb)
|
||||||
return self->format_cb (self, value, self->format_data);
|
return self->format_cb (self, value, self->format_data);
|
||||||
@@ -121,8 +125,8 @@ apply_value (GcalMultiChoice *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
set_value (GcalMultiChoice *self,
|
set_value (GcalMultiChoice *self,
|
||||||
gint value,
|
gint value,
|
||||||
GtkStackTransitionType transition)
|
GtkStackTransitionType transition)
|
||||||
{
|
{
|
||||||
value = CLAMP (value, self->min_value, self->max_value);
|
value = CLAMP (value, self->min_value, self->max_value);
|
||||||
|
|
||||||
@@ -202,7 +206,7 @@ update_sensitivity (GcalMultiChoice *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
button_clicked_cb (GtkWidget *button,
|
button_clicked_cb (GtkWidget *button,
|
||||||
GcalMultiChoice *self)
|
GcalMultiChoice *self)
|
||||||
{
|
{
|
||||||
if (button == self->down_button)
|
if (button == self->down_button)
|
||||||
@@ -285,9 +289,9 @@ gcal_multi_choice_dispose (GObject *object)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_get_property (GObject *object,
|
gcal_multi_choice_get_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self = GCAL_MULTI_CHOICE (object);
|
GcalMultiChoice *self = GCAL_MULTI_CHOICE (object);
|
||||||
|
|
||||||
@@ -325,9 +329,9 @@ gcal_multi_choice_get_property (GObject *object,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_set_property (GObject *object,
|
gcal_multi_choice_set_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self = GCAL_MULTI_CHOICE (object);
|
GcalMultiChoice *self = GCAL_MULTI_CHOICE (object);
|
||||||
|
|
||||||
@@ -375,7 +379,7 @@ gcal_multi_choice_set_property (GObject *object,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_notify (GObject *object,
|
gcal_multi_choice_notify (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
if (strcmp (pspec->name, "focus-on-click") == 0)
|
if (strcmp (pspec->name, "focus-on-click") == 0)
|
||||||
{
|
{
|
||||||
@@ -395,7 +399,7 @@ gcal_multi_choice_notify (GObject *object,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_state_flags_changed (GtkWidget *widget,
|
gcal_multi_choice_state_flags_changed (GtkWidget *widget,
|
||||||
GtkStateFlags previous_state_flags)
|
GtkStateFlags previous_state_flags)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
||||||
|
|
||||||
@@ -408,12 +412,12 @@ gcal_multi_choice_state_flags_changed (GtkWidget *widget,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_measure (GtkWidget *widget,
|
gcal_multi_choice_measure (GtkWidget *widget,
|
||||||
GtkOrientation orientation,
|
GtkOrientation orientation,
|
||||||
int for_size,
|
int for_size,
|
||||||
int *minimum,
|
int *minimum,
|
||||||
int *natural,
|
int *natural,
|
||||||
int *minimum_baseline,
|
int *minimum_baseline,
|
||||||
int *natural_baseline)
|
int *natural_baseline)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
||||||
|
|
||||||
@@ -427,9 +431,9 @@ gcal_multi_choice_measure (GtkWidget *widget,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_multi_choice_size_allocate (GtkWidget *widget,
|
gcal_multi_choice_size_allocate (GtkWidget *widget,
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
int baseline)
|
int baseline)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self= GCAL_MULTI_CHOICE (widget);
|
GcalMultiChoice *self= GCAL_MULTI_CHOICE (widget);
|
||||||
|
|
||||||
@@ -442,7 +446,7 @@ gcal_multi_choice_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gcal_multi_choice_focus (GtkWidget *widget,
|
gcal_multi_choice_focus (GtkWidget *widget,
|
||||||
GtkDirectionType direction)
|
GtkDirectionType direction)
|
||||||
{
|
{
|
||||||
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
GcalMultiChoice *self = GCAL_MULTI_CHOICE (widget);
|
||||||
|
|
||||||
@@ -566,7 +570,7 @@ gcal_multi_choice_new (void)
|
|||||||
|
|
||||||
void
|
void
|
||||||
gcal_multi_choice_set_value (GcalMultiChoice *self,
|
gcal_multi_choice_set_value (GcalMultiChoice *self,
|
||||||
gint value)
|
gint value)
|
||||||
{
|
{
|
||||||
set_value (self, value, GTK_STACK_TRANSITION_TYPE_NONE);
|
set_value (self, value, GTK_STACK_TRANSITION_TYPE_NONE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user