2009-07-14 00:21:31 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* 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 "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2009-10-12 04:06:54 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2009-07-14 00:21:31 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "widgets-types.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpcontext.h"
|
2009-10-12 04:06:54 +08:00
|
|
|
#include "core/gimpdynamics.h"
|
2009-10-03 17:59:45 +08:00
|
|
|
|
2009-07-14 00:21:31 +08:00
|
|
|
#include "gimpdocked.h"
|
2009-08-23 22:56:03 +08:00
|
|
|
#include "gimpdynamicseditor.h"
|
2009-10-12 04:06:54 +08:00
|
|
|
#include "gimpmenufactory.h"
|
2009-08-23 22:56:03 +08:00
|
|
|
#include "gimppropwidgets.h"
|
|
|
|
|
2009-10-12 04:06:54 +08:00
|
|
|
#include "gimp-intl.h"
|
2009-10-08 04:32:17 +08:00
|
|
|
|
2009-07-14 00:21:31 +08:00
|
|
|
|
2009-10-12 04:06:54 +08:00
|
|
|
/* local function prototypes */
|
2009-07-14 00:21:31 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
static GObject * gimp_dynamics_editor_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params);
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
static void gimp_dynamics_editor_set_data (GimpDataEditor *editor,
|
|
|
|
GimpData *data);
|
2009-07-14 00:21:31 +08:00
|
|
|
|
2009-10-11 03:47:25 +08:00
|
|
|
static void gimp_dynamics_editor_notify_model (GimpDynamics *options,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpDynamicsEditor *editor);
|
|
|
|
static void gimp_dynamics_editor_notify_data (GimpDynamics *options,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpDynamicsEditor *editor);
|
2009-07-14 00:21:31 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
static void dynamics_output_maping_row_gui (GObject *config,
|
2009-10-12 03:25:28 +08:00
|
|
|
const gchar *row_label,
|
2009-10-08 04:32:17 +08:00
|
|
|
GtkTable *table,
|
|
|
|
gint row,
|
|
|
|
GtkWidget *labels[]);
|
|
|
|
|
|
|
|
static GtkWidget * dynamics_check_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
GtkTable *table,
|
|
|
|
gint column,
|
|
|
|
gint row);
|
|
|
|
|
|
|
|
|
|
|
|
static void dynamics_check_button_size_allocate (GtkWidget *toggle,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
GtkWidget *label);
|
|
|
|
|
2009-07-14 00:21:31 +08:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GimpDynamicsEditor, gimp_dynamics_editor,
|
|
|
|
GIMP_TYPE_DATA_EDITOR,
|
2009-10-12 04:06:54 +08:00
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED, NULL))
|
2009-07-14 00:21:31 +08:00
|
|
|
|
|
|
|
#define parent_class gimp_dynamics_editor_parent_class
|
|
|
|
|
|
|
|
|
2009-10-12 04:06:54 +08:00
|
|
|
static void
|
|
|
|
gimp_dynamics_editor_class_init (GimpDynamicsEditorClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpDataEditorClass *editor_class = GIMP_DATA_EDITOR_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->constructor = gimp_dynamics_editor_constructor;
|
|
|
|
|
|
|
|
editor_class->set_data = gimp_dynamics_editor_set_data;
|
|
|
|
editor_class->title = _("Dynamics Editor");
|
|
|
|
}
|
2009-07-14 00:21:31 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_dynamics_editor_init (GimpDynamicsEditor *editor)
|
|
|
|
{
|
2009-08-23 22:56:03 +08:00
|
|
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
2009-10-11 03:47:25 +08:00
|
|
|
GimpDynamics *dynamics;
|
|
|
|
GObject *config;
|
2009-08-23 22:56:03 +08:00
|
|
|
GtkWidget *vbox;
|
2009-08-20 23:51:07 +08:00
|
|
|
GtkWidget *table;
|
|
|
|
gint n_dynamics = 0;
|
2009-10-08 04:32:17 +08:00
|
|
|
GtkWidget *dynamics_labels[6];
|
2009-10-11 03:47:25 +08:00
|
|
|
|
|
|
|
editor->dynamics_model = g_object_new (GIMP_TYPE_DYNAMICS, NULL);
|
|
|
|
|
|
|
|
g_signal_connect (editor->dynamics_model, "notify",
|
|
|
|
G_CALLBACK (gimp_dynamics_editor_notify_model),
|
|
|
|
editor);
|
|
|
|
|
|
|
|
dynamics = editor->dynamics_model;
|
|
|
|
|
|
|
|
config = G_OBJECT (dynamics);
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-03 17:59:45 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 6);
|
2009-10-03 18:03:51 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (data_editor), vbox, TRUE, TRUE, 0);
|
2009-10-03 17:59:45 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Pressure"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Velocity"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Direction"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Tilt"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Random"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_labels[n_dynamics] = gtk_label_new (_("Fade"));
|
2009-08-26 02:28:24 +08:00
|
|
|
n_dynamics++;
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
/* NB: When adding new dynamics driver, increase size of the
|
2009-08-23 22:56:03 +08:00
|
|
|
* dynamics_labels[] array
|
|
|
|
*/
|
2009-08-20 23:51:07 +08:00
|
|
|
|
|
|
|
if (n_dynamics > 0)
|
|
|
|
{
|
|
|
|
GtkWidget *inner_frame;
|
2009-08-26 02:28:24 +08:00
|
|
|
GtkWidget *fixed;
|
|
|
|
gint i;
|
|
|
|
gboolean rtl = gtk_widget_get_direction (vbox) == GTK_TEXT_DIR_RTL;
|
|
|
|
|
|
|
|
|
2009-08-20 23:51:07 +08:00
|
|
|
inner_frame = gimp_frame_new (NULL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), inner_frame);
|
|
|
|
gtk_widget_show (inner_frame);
|
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
table = gtk_table_new (9, n_dynamics + 2, FALSE);
|
2009-08-20 23:51:07 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (inner_frame), table);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2009-08-23 22:56:03 +08:00
|
|
|
|
2009-10-12 03:25:28 +08:00
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->opacity_dynamics),
|
|
|
|
_("Opacity"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
1,
|
|
|
|
dynamics_labels);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->hardness_dynamics),
|
|
|
|
_("Hardness"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
2,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->rate_dynamics),
|
|
|
|
_("Rate"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
3,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->size_dynamics),
|
|
|
|
_("Size"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
4,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->aspect_ratio_dynamics),
|
|
|
|
_("Aspect ratio"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
5,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->color_dynamics),
|
|
|
|
_("Color"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
6,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->angle_dynamics),
|
|
|
|
_("Angle"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
7,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
dynamics_output_maping_row_gui (G_OBJECT (dynamics->jitter_dynamics),
|
|
|
|
_("Jitter"),
|
|
|
|
GTK_TABLE (table),
|
|
|
|
8,
|
|
|
|
NULL);
|
|
|
|
|
2009-08-26 02:28:24 +08:00
|
|
|
fixed = gtk_fixed_new ();
|
|
|
|
gtk_table_attach (GTK_TABLE (table), fixed, 0, n_dynamics + 2, 0, 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (fixed);
|
|
|
|
|
|
|
|
for (i = 0; i < n_dynamics; i++)
|
|
|
|
{
|
|
|
|
gtk_label_set_angle (GTK_LABEL (dynamics_labels[i]),
|
2009-10-08 00:32:37 +08:00
|
|
|
90);
|
2009-08-26 02:28:24 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (dynamics_labels[i]), 1.0, 1.0);
|
|
|
|
gtk_fixed_put (GTK_FIXED (fixed), dynamics_labels[i], 0, 0);
|
|
|
|
gtk_widget_show (dynamics_labels[i]);
|
|
|
|
}
|
|
|
|
}
|
2009-08-23 22:56:03 +08:00
|
|
|
}
|
2009-07-14 00:21:31 +08:00
|
|
|
|
2009-10-11 03:47:25 +08:00
|
|
|
static GObject *
|
|
|
|
gimp_dynamics_editor_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
|
|
|
{
|
|
|
|
GObject *object;
|
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
|
|
|
|
|
|
|
gimp_docked_set_show_button_bar (GIMP_DOCKED (object), FALSE);
|
|
|
|
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_dynamics_editor_set_data (GimpDataEditor *editor,
|
|
|
|
GimpData *data)
|
|
|
|
{
|
|
|
|
GimpDynamicsEditor *dynamics_editor = GIMP_DYNAMICS_EDITOR (editor);
|
|
|
|
|
|
|
|
if (editor->data)
|
|
|
|
g_signal_handlers_disconnect_by_func (editor->data,
|
|
|
|
gimp_dynamics_editor_notify_data,
|
|
|
|
editor);
|
|
|
|
|
|
|
|
GIMP_DATA_EDITOR_CLASS (parent_class)->set_data (editor, data);
|
|
|
|
|
|
|
|
if (editor->data)
|
2009-10-11 05:02:18 +08:00
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (dynamics_editor->dynamics_model,
|
|
|
|
gimp_dynamics_editor_notify_model,
|
|
|
|
editor);
|
|
|
|
|
|
|
|
gimp_config_copy (GIMP_CONFIG (editor->data),
|
|
|
|
GIMP_CONFIG (dynamics_editor->dynamics_model),
|
2009-10-12 03:25:28 +08:00
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE);
|
2009-10-11 05:02:18 +08:00
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (dynamics_editor->dynamics_model,
|
|
|
|
gimp_dynamics_editor_notify_model,
|
|
|
|
editor);
|
|
|
|
|
|
|
|
g_signal_connect (editor->data, "notify",
|
|
|
|
G_CALLBACK (gimp_dynamics_editor_notify_data),
|
|
|
|
editor);
|
|
|
|
}
|
2009-10-11 03:47:25 +08:00
|
|
|
}
|
|
|
|
|
2009-10-12 04:06:54 +08:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
gimp_dynamics_editor_new (GimpContext *context,
|
|
|
|
GimpMenuFactory *menu_factory)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL);
|
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
|
|
|
|
|
|
|
return g_object_new (GIMP_TYPE_DYNAMICS_EDITOR,
|
|
|
|
"menu-factory", menu_factory,
|
|
|
|
"menu-identifier", "<DynamicsEditor>",
|
|
|
|
"ui-path", "/dynamics-editor-popup",
|
|
|
|
"data-factory", context->gimp->dynamics_factory,
|
|
|
|
"context", context,
|
|
|
|
"data", gimp_context_get_dynamics (context),
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2009-10-11 03:47:25 +08:00
|
|
|
static void
|
|
|
|
gimp_dynamics_editor_notify_model (GimpDynamics *options,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpDynamicsEditor *editor)
|
|
|
|
{
|
|
|
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
|
|
|
|
|
|
|
if (data_editor->data)
|
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (data_editor->data,
|
|
|
|
gimp_dynamics_editor_notify_data,
|
|
|
|
editor);
|
|
|
|
|
|
|
|
gimp_config_copy (GIMP_CONFIG (editor->dynamics_model),
|
|
|
|
GIMP_CONFIG (data_editor->data),
|
2009-10-12 03:25:28 +08:00
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE);
|
2009-10-11 03:47:25 +08:00
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (data_editor->data,
|
|
|
|
gimp_dynamics_editor_notify_data,
|
|
|
|
editor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_dynamics_editor_notify_data (GimpDynamics *options,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpDynamicsEditor *editor)
|
|
|
|
{
|
|
|
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func (editor->dynamics_model,
|
|
|
|
gimp_dynamics_editor_notify_model,
|
|
|
|
editor);
|
|
|
|
|
|
|
|
gimp_config_copy (GIMP_CONFIG (data_editor->data),
|
|
|
|
GIMP_CONFIG (editor->dynamics_model),
|
2009-10-12 03:25:28 +08:00
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE);
|
2009-10-11 03:47:25 +08:00
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (editor->dynamics_model,
|
|
|
|
gimp_dynamics_editor_notify_model,
|
|
|
|
editor);
|
|
|
|
}
|
|
|
|
|
2009-07-14 00:21:31 +08:00
|
|
|
static void
|
2009-10-12 03:25:28 +08:00
|
|
|
dynamics_output_maping_row_gui (GObject *config,
|
|
|
|
const gchar *row_label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint row,
|
|
|
|
GtkWidget *labels[])
|
2009-07-14 00:21:31 +08:00
|
|
|
{
|
2009-10-12 03:25:28 +08:00
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *button;
|
|
|
|
gint column = 1;
|
|
|
|
|
|
|
|
label = gtk_label_new (row_label);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row + 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "pressure",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "velocity",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "direction",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "tilt",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "random",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
|
|
|
|
|
|
|
button = dynamics_check_button_new (config, "fade",
|
|
|
|
table, column, row);
|
|
|
|
if (labels)
|
|
|
|
g_signal_connect (button, "size-allocate",
|
|
|
|
G_CALLBACK (dynamics_check_button_size_allocate),
|
|
|
|
labels[column - 1]);
|
|
|
|
column++;
|
2009-07-14 00:21:31 +08:00
|
|
|
}
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
static GtkWidget *
|
|
|
|
dynamics_check_button_new (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
GtkTable *table,
|
|
|
|
gint column,
|
|
|
|
gint row)
|
2009-08-26 02:28:24 +08:00
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
button = gimp_prop_check_button_new (config, property_name, NULL);
|
|
|
|
gtk_table_attach (table, button, column, column + 1, row, row + 1,
|
|
|
|
GTK_SHRINK, GTK_SHRINK, 0, 0);
|
|
|
|
gtk_widget_show (button);
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
return button;
|
2009-08-26 02:28:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-10-08 04:32:17 +08:00
|
|
|
dynamics_check_button_size_allocate (GtkWidget *toggle,
|
|
|
|
GtkAllocation *allocation,
|
|
|
|
GtkWidget *label)
|
2009-08-26 02:28:24 +08:00
|
|
|
{
|
2009-10-08 04:32:17 +08:00
|
|
|
GtkWidget *fixed = label->parent;
|
|
|
|
gint x, y;
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
if (gtk_widget_get_direction (label) == GTK_TEXT_DIR_LTR)
|
|
|
|
x = allocation->x;
|
|
|
|
else
|
|
|
|
x = allocation->x + allocation->width - label->allocation.width;
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
x -= fixed->allocation.x;
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
y = fixed->allocation.height - label->allocation.height;
|
2009-08-26 02:28:24 +08:00
|
|
|
|
2009-10-08 04:32:17 +08:00
|
|
|
gtk_fixed_move (GTK_FIXED (fixed), label, x, y);
|
2009-08-26 02:28:24 +08:00
|
|
|
}
|