[gnome-shell/wip/clutter-deprecation-fixes: 25/27] st: Remove st-tooltip
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/clutter-deprecation-fixes: 25/27] st: Remove st-tooltip
- Date: Tue, 14 Feb 2012 16:50:02 +0000 (UTC)
commit 1c919e95464265affa63150bc928f0e2db4e727a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Feb 13 12:08:05 2012 -0500
st: Remove st-tooltip
StTooltip has been plagued by lots of issues, and we recently ditched
it in the dash. Remove it for good.
js/ui/dnd.js | 4 +-
js/ui/main.js | 1 -
js/ui/panelMenu.js | 16 +-
js/ui/status/accessibility.js | 2 +-
js/ui/status/bluetooth.js | 2 +-
js/ui/status/network.js | 2 +-
js/ui/status/power.js | 2 +-
js/ui/status/volume.js | 2 +-
src/Makefile-st.am | 2 -
src/shell-global.c | 42 ----
src/st/st-button.c | 4 -
src/st/st-tooltip.c | 525 -----------------------------------------
src/st/st-tooltip.h | 91 -------
src/st/st-widget.c | 449 +----------------------------------
src/st/st-widget.h | 14 -
15 files changed, 16 insertions(+), 1142 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index cb8b913..04149cc 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -103,8 +103,8 @@ const _Draggable = new Lang.Class({
this._dragInProgress = false; // The drag has been started, and has not been dropped or cancelled yet.
this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
- // During the drag, we eat enter/leave events so that actors don't prelight or show
- // tooltips. But we remember the actors that we first left/last entered so we can
+ // During the drag, we eat enter/leave events so that actors don't prelight.
+ // But we remember the actors that we first left/last entered so we can
// fix up the hover state after the drag ends.
this._firstLeaveActor = null;
this._lastEnterActor = null;
diff --git a/js/ui/main.js b/js/ui/main.js
index 6b7218b..60c3133 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -187,7 +187,6 @@ function start() {
for (let i = 0; i < children.length; i++)
children[i].allocate_preferred_size(flags);
});
- St.set_ui_root(global.stage, uiGroup);
global.window_group.reparent(uiGroup);
global.overlay_group.reparent(uiGroup);
global.stage.add_actor(uiGroup);
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 66f4813..6f15d2a 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -215,13 +215,13 @@ Signals.addSignalMethods(Button.prototype);
*
* This class manages one System Status indicator (network, keyboard,
* volume, bluetooth...), which is just a PanelMenuButton with an
- * icon and a tooltip
+ * icon.
*/
const SystemStatusButton = new Lang.Class({
Name: 'SystemStatusButton',
Extends: Button,
- _init: function(iconName, tooltipText, nameText) {
+ _init: function(iconName, nameText) {
this.parent(0.0, nameText);
this._iconActor = new St.Icon({ icon_name: iconName,
@@ -229,7 +229,6 @@ const SystemStatusButton = new Lang.Class({
style_class: 'system-status-icon' });
this.actor.add_actor(this._iconActor);
this.actor.add_style_class_name('panel-status-button');
- this.setTooltip(tooltipText);
},
setIcon: function(iconName) {
@@ -238,16 +237,5 @@ const SystemStatusButton = new Lang.Class({
setGIcon: function(gicon) {
this._iconActor.gicon = gicon;
- },
-
- setTooltip: function(text) {
- if (text != null) {
- this.tooltip = text;
- this.actor.has_tooltip = true;
- this.actor.tooltip_text = text;
- } else {
- this.actor.has_tooltip = false;
- this.tooltip = null;
- }
}
});
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index bda0e01..42d3a3c 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -44,7 +44,7 @@ const ATIndicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('preferences-desktop-accessibility', null, _("Accessibility"));
+ this.parent('preferences-desktop-accessibility', _("Accessibility"));
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index 34b1b18..ea864a7 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -28,7 +28,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('bluetooth-disabled', null, _("Bluetooth"));
+ this.parent('bluetooth-disabled', _("Bluetooth"));
this._applet = new GnomeBluetoothApplet.Applet();
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index f6cd8d0..5c6babe 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1538,7 +1538,7 @@ const NMApplet = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('network-error', null, _("Network"));
+ this.parent('network-error', _("Network"));
this._client = NMClient.Client.new();
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 9391bf8..84f6b2d 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -56,7 +56,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('battery-missing', null, _("Battery"));
+ this.parent('battery-missing', _("Battery"));
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index ac4382f..ff907ca 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -22,7 +22,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('audio-volume-muted', null, _("Volume"));
+ this.parent('audio-volume-muted', _("Volume"));
this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
diff --git a/src/Makefile-st.am b/src/Makefile-st.am
index 4510ead..0ae490a 100644
--- a/src/Makefile-st.am
+++ b/src/Makefile-st.am
@@ -68,7 +68,6 @@ st_source_h = \
st/st-theme.h \
st/st-theme-context.h \
st/st-theme-node.h \
- st/st-tooltip.h \
st/st-types.h \
st/st-widget.h \
st/st-widget-accessible.h \
@@ -124,7 +123,6 @@ st_source_c = \
st/st-theme-node.c \
st/st-theme-node-drawing.c \
st/st-theme-node-transition.c \
- st/st-tooltip.c \
st/st-widget.c \
$(NULL)
diff --git a/src/shell-global.c b/src/shell-global.c
index 2e7e200..8853852 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -792,46 +792,6 @@ global_stage_after_paint (ClutterStage *stage,
}
static void
-constrain_tooltip (StTooltip *tooltip,
- const ClutterGeometry *geometry,
- ClutterGeometry *adjusted_geometry,
- gpointer data)
-{
- const ClutterGeometry *tip_area = st_tooltip_get_tip_area (tooltip);
- ShellGlobal *global = shell_global_get ();
- MetaScreen *screen = shell_global_get_screen (global);
- int n_monitors = meta_screen_get_n_monitors (screen);
- int i;
-
- *adjusted_geometry = *geometry;
-
- /* A point that determines what screen we'll constrain to */
- int x = tip_area->x + tip_area->width / 2;
- int y = tip_area->y + tip_area->height / 2;
-
- for (i = 0; i < n_monitors; i++)
- {
- MetaRectangle rect;
- meta_screen_get_monitor_geometry (screen, i, &rect);
- if (x >= rect.x && x < rect.x + rect.width &&
- y >= rect.y && y < rect.y + rect.height)
- {
- if (adjusted_geometry->x + adjusted_geometry->width > rect.x + rect.width)
- adjusted_geometry->x = rect.x + rect.width - adjusted_geometry->width;
- if (adjusted_geometry->x < rect.x)
- adjusted_geometry->x = rect.x;
-
- if (adjusted_geometry->y + adjusted_geometry->height > rect.y + rect.height)
- adjusted_geometry->y = rect.y + rect.height - adjusted_geometry->height;
- if (adjusted_geometry->y < rect.y)
- adjusted_geometry->y = rect.y;
-
- return;
- }
- }
-}
-
-static void
update_font_options (GtkSettings *settings,
ClutterStage *stage)
{
@@ -860,8 +820,6 @@ update_font_options (GtkSettings *settings,
else
st_theme_context_set_default_resolution (context);
- st_tooltip_set_constrain_func (stage, constrain_tooltip, NULL, NULL);
-
/* Clutter (as of 0.9) passes comprehensively wrong font options
* override whatever set_font_flags() did above.
*
diff --git a/src/st/st-button.c b/src/st/st-button.c
index 4d146ef..91415cc 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -163,8 +163,6 @@ st_button_button_press (ClutterActor *actor,
StButton *button = ST_BUTTON (actor);
StButtonMask mask = ST_BUTTON_MASK_FROM_BUTTON (event->button);
- st_widget_hide_tooltip (ST_WIDGET (actor));
-
if (button->priv->button_mask & mask)
{
if (button->priv->grabbed == 0)
@@ -209,8 +207,6 @@ st_button_key_press (ClutterActor *actor,
{
StButton *button = ST_BUTTON (actor);
- st_widget_hide_tooltip (ST_WIDGET (actor));
-
if (button->priv->button_mask & ST_BUTTON_ONE)
{
if (event->keyval == CLUTTER_KEY_space ||
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 7bfd33c..5ae2428 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -38,7 +38,6 @@
#include "st-private.h"
#include "st-texture-cache.h"
#include "st-theme-context.h"
-#include "st-tooltip.h"
#include "st-theme-node-transition.h"
#include "st-widget-accessible.h"
@@ -57,11 +56,8 @@ struct _StWidgetPrivate
gchar *inline_style;
StThemeNodeTransition *transition_animation;
- guint tooltip_timeout_id;
gboolean is_stylable : 1;
- gboolean has_tooltip : 1;
- gboolean show_tooltip : 1;
gboolean is_style_dirty : 1;
gboolean draw_bg_color : 1;
gboolean draw_border_internal : 1;
@@ -69,8 +65,6 @@ struct _StWidgetPrivate
gboolean hover : 1;
gboolean can_focus : 1;
- StTooltip *tooltip;
-
StTextDirection direction;
AtkObject *accessible;
@@ -104,8 +98,6 @@ enum
PROP_STYLE_CLASS,
PROP_STYLE,
PROP_STYLABLE,
- PROP_HAS_TOOLTIP,
- PROP_TOOLTIP_TEXT,
PROP_TRACK_HOVER,
PROP_HOVER,
PROP_CAN_FOCUS,
@@ -136,10 +128,6 @@ static gboolean st_widget_real_navigate_focus (StWidget *widget,
static AtkObject * st_widget_get_accessible (ClutterActor *actor);
-static void st_widget_start_tooltip_timeout (StWidget *widget);
-static void st_widget_do_show_tooltip (StWidget *widget);
-static void st_widget_do_hide_tooltip (StWidget *widget);
-
static void
st_widget_set_property (GObject *gobject,
guint prop_id,
@@ -174,14 +162,6 @@ st_widget_set_property (GObject *gobject,
}
break;
- case PROP_HAS_TOOLTIP:
- st_widget_set_has_tooltip (actor, g_value_get_boolean (value));
- break;
-
- case PROP_TOOLTIP_TEXT:
- st_widget_set_tooltip_text (actor, g_value_get_string (value));
- break;
-
case PROP_TRACK_HOVER:
st_widget_set_track_hover (actor, g_value_get_boolean (value));
break;
@@ -235,14 +215,6 @@ st_widget_get_property (GObject *gobject,
g_value_set_boolean (value, priv->is_stylable);
break;
- case PROP_HAS_TOOLTIP:
- g_value_set_boolean (value, priv->has_tooltip);
- break;
-
- case PROP_TOOLTIP_TEXT:
- g_value_set_string (value, st_widget_get_tooltip_text (actor));
- break;
-
case PROP_TRACK_HOVER:
g_value_set_boolean (value, priv->track_hover);
break;
@@ -297,19 +269,6 @@ st_widget_dispose (GObject *gobject)
st_widget_remove_transition (actor);
- if (priv->tooltip_timeout_id)
- {
- g_source_remove (priv->tooltip_timeout_id);
- priv->tooltip_timeout_id = 0;
- }
-
- if (priv->tooltip)
- {
- clutter_actor_destroy (CLUTTER_ACTOR (priv->tooltip));
- g_object_unref (priv->tooltip);
- priv->tooltip = NULL;
- }
-
/* The real dispose of this accessible is done on
* AtkGObjectAccessible weak ref callback
*/
@@ -375,29 +334,9 @@ st_widget_allocate (ClutterActor *actor,
const ClutterActorBox *box,
ClutterAllocationFlags flags)
{
- StWidgetPrivate *priv = ST_WIDGET (self)->priv;
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
ClutterActorBox content_box;
- /* update tooltip position */
- if (priv->tooltip)
- {
- ClutterGeometry area;
- ClutterVertex in_v, out_v;
- in_v.x = in_v.y = in_v.z = 0;
- clutter_actor_apply_transform_to_point (actor, &in_v, &out_v);
- area.x = out_v.x;
- area.y = out_v.y;
-
- in_v.x = box->x2 - box->x1;
- in_v.y = box->y2 - box->y1;
- clutter_actor_apply_transform_to_point (actor, &in_v, &out_v);
- area.width = out_v.x - area.x;
- area.height = out_v.y - area.y;
-
- st_tooltip_set_tip_area (priv->tooltip, &area);
- }
-
/* Note that we can't just chain up to clutter_actor_real_allocate --
* Clutter does some dirty tricks for backwards compatibility.
* Clutter also passes the actor's allocation directly to the layout
@@ -480,9 +419,6 @@ st_widget_map (ClutterActor *actor)
CLUTTER_ACTOR_CLASS (st_widget_parent_class)->map (actor);
st_widget_ensure_style (self);
-
- if (self->priv->show_tooltip)
- st_widget_do_show_tooltip (self);
}
static void
@@ -495,8 +431,6 @@ st_widget_unmap (ClutterActor *actor)
if (priv->track_hover && priv->hover)
st_widget_set_hover (self, FALSE);
-
- st_widget_do_hide_tooltip (self);
}
static void
@@ -716,19 +650,6 @@ st_widget_leave (ClutterActor *actor,
return FALSE;
}
-static gboolean
-st_widget_motion (ClutterActor *actor,
- ClutterMotionEvent *motion)
-{
- StWidget *widget = ST_WIDGET (actor);
- StWidgetPrivate *priv = widget->priv;
-
- if (priv->has_tooltip)
- st_widget_start_tooltip_timeout (widget);
-
- return FALSE;
-}
-
static void
st_widget_key_focus_in (ClutterActor *actor)
{
@@ -760,18 +681,6 @@ st_widget_key_press_event (ClutterActor *actor,
return FALSE;
}
-static void
-st_widget_hide (ClutterActor *actor)
-{
- StWidget *widget = (StWidget *) actor;
-
- /* hide the tooltip, if there is one */
- if (widget->priv->tooltip)
- clutter_actor_hide (CLUTTER_ACTOR (widget->priv->tooltip));
-
- CLUTTER_ACTOR_CLASS (st_widget_parent_class)->hide (actor);
-}
-
static gboolean
st_widget_get_paint_volume (ClutterActor *self,
ClutterPaintVolume *volume)
@@ -831,11 +740,9 @@ st_widget_class_init (StWidgetClass *klass)
actor_class->enter_event = st_widget_enter;
actor_class->leave_event = st_widget_leave;
- actor_class->motion_event = st_widget_motion;
actor_class->key_focus_in = st_widget_key_focus_in;
actor_class->key_focus_out = st_widget_key_focus_out;
actor_class->key_press_event = st_widget_key_press_event;
- actor_class->hide = st_widget_hide;
actor_class->get_accessible = st_widget_get_accessible;
@@ -913,35 +820,6 @@ st_widget_class_init (StWidgetClass *klass)
pspec);
/**
- * StWidget:has-tooltip:
- *
- * Determines whether the widget has a tooltip. If set to %TRUE, causes the
- * widget to monitor hover state (i.e. sets #ClutterActor:reactive and
- * #StWidget:track-hover).
- */
- pspec = g_param_spec_boolean ("has-tooltip",
- "Has Tooltip",
- "Determines whether the widget has a tooltip",
- FALSE,
- ST_PARAM_READWRITE);
- g_object_class_install_property (gobject_class,
- PROP_HAS_TOOLTIP,
- pspec);
-
-
- /**
- * StWidget:tooltip-text:
- *
- * text displayed on the tooltip
- */
- pspec = g_param_spec_string ("tooltip-text",
- "Tooltip Text",
- "Text displayed on the tooltip",
- "",
- ST_PARAM_READWRITE);
- g_object_class_install_property (gobject_class, PROP_TOOLTIP_TEXT, pspec);
-
- /**
* StWidget:track-hover:
*
* Determines whether the widget tracks pointer hover state. If
@@ -1622,211 +1500,6 @@ st_widget_set_direction (StWidget *self, StTextDirection dir)
st_widget_style_changed (self);
}
-static void
-st_widget_ensure_tooltip_parented (StWidget *widget, ClutterStage *stage)
-{
- StWidgetPrivate *priv;
- ClutterContainer *ui_root;
- ClutterActor *tooltip, *parent;
-
- priv = widget->priv;
-
- ui_root = st_get_ui_root (stage);
-
- tooltip = CLUTTER_ACTOR (priv->tooltip);
- parent = clutter_actor_get_parent (tooltip);
-
- if (G_UNLIKELY (parent != CLUTTER_ACTOR (ui_root)))
- {
- if (parent)
- clutter_container_remove_actor (CLUTTER_CONTAINER (parent), tooltip);
-
- clutter_container_add_actor (ui_root, tooltip);
- }
-}
-
-/**
- * st_widget_set_has_tooltip:
- * @widget: A #StWidget
- * @has_tooltip: %TRUE if the widget should display a tooltip
- *
- * Enables tooltip support on the #StWidget.
- *
- * Note that setting has-tooltip to %TRUE will cause
- * #ClutterActor:reactive and #StWidget:track-hover to be set %TRUE as
- * well, but you must clear these flags yourself (if appropriate) when
- * setting it %FALSE.
- */
-void
-st_widget_set_has_tooltip (StWidget *widget,
- gboolean has_tooltip)
-{
- StWidgetPrivate *priv;
- ClutterActor *stage;
-
- g_return_if_fail (ST_IS_WIDGET (widget));
-
- priv = widget->priv;
-
- priv->has_tooltip = has_tooltip;
-
- if (has_tooltip)
- {
- clutter_actor_set_reactive ((ClutterActor*) widget, TRUE);
- st_widget_set_track_hover (widget, TRUE);
-
- if (!priv->tooltip)
- {
- priv->tooltip = g_object_new (ST_TYPE_TOOLTIP, NULL);
- g_object_ref_sink (priv->tooltip);
-
- stage = clutter_actor_get_stage (CLUTTER_ACTOR (widget));
- if (stage != NULL)
- st_widget_ensure_tooltip_parented (widget, CLUTTER_STAGE (stage));
- }
- }
- else
- {
- if (priv->tooltip_timeout_id)
- {
- g_source_remove (priv->tooltip_timeout_id);
- priv->tooltip_timeout_id = 0;
- }
-
- if (priv->tooltip)
- {
- clutter_actor_destroy (CLUTTER_ACTOR (priv->tooltip));
- g_object_unref (priv->tooltip);
- priv->tooltip = NULL;
- }
- }
-}
-
-/**
- * st_widget_get_has_tooltip:
- * @widget: A #StWidget
- *
- * Returns the current value of the has-tooltip property. See
- * st_tooltip_set_has_tooltip() for more information.
- *
- * Returns: current value of has-tooltip on @widget
- */
-gboolean
-st_widget_get_has_tooltip (StWidget *widget)
-{
- g_return_val_if_fail (ST_IS_WIDGET (widget), FALSE);
-
- return widget->priv->has_tooltip;
-}
-
-/**
- * st_widget_set_tooltip_text:
- * @widget: A #StWidget
- * @text: text to set as the tooltip
- *
- * Set the tooltip text of the widget. This will set StWidget::has-tooltip to
- * %TRUE. A value of %NULL will unset the tooltip and set has-tooltip to %FALSE.
- *
- */
-void
-st_widget_set_tooltip_text (StWidget *widget,
- const gchar *text)
-{
- StWidgetPrivate *priv;
-
- g_return_if_fail (ST_IS_WIDGET (widget));
-
- priv = widget->priv;
-
- if (text == NULL)
- st_widget_set_has_tooltip (widget, FALSE);
- else
- {
- st_widget_set_has_tooltip (widget, TRUE);
- st_tooltip_set_label (priv->tooltip, text);
- }
-}
-
-/**
- * st_widget_get_tooltip_text:
- * @widget: A #StWidget
- *
- * Get the current tooltip string
- *
- * Returns: The current tooltip string, owned by the #StWidget
- */
-const gchar*
-st_widget_get_tooltip_text (StWidget *widget)
-{
- StWidgetPrivate *priv;
-
- g_return_val_if_fail (ST_IS_WIDGET (widget), NULL);
- priv = widget->priv;
-
- if (!priv->has_tooltip)
- return NULL;
-
- return st_tooltip_get_label (widget->priv->tooltip);
-}
-
-/**
- * st_widget_show_tooltip:
- * @widget: A #StWidget
- *
- * Force the tooltip for @widget to be shown
- *
- */
-void
-st_widget_show_tooltip (StWidget *widget)
-{
- g_return_if_fail (ST_IS_WIDGET (widget));
-
- widget->priv->show_tooltip = TRUE;
- if (CLUTTER_ACTOR_IS_MAPPED (widget))
- st_widget_do_show_tooltip (widget);
-}
-
-static void
-st_widget_do_show_tooltip (StWidget *widget)
-{
- ClutterActor *stage, *tooltip;
-
- stage = clutter_actor_get_stage (CLUTTER_ACTOR (widget));
- g_return_if_fail (stage != NULL);
-
- if (widget->priv->tooltip)
- {
- tooltip = CLUTTER_ACTOR (widget->priv->tooltip);
- st_widget_ensure_tooltip_parented (widget, CLUTTER_STAGE (stage));
- clutter_actor_raise (tooltip, NULL);
- clutter_actor_show_all (tooltip);
- }
-}
-
-/**
- * st_widget_hide_tooltip:
- * @widget: A #StWidget
- *
- * Hide the tooltip for @widget
- *
- */
-void
-st_widget_hide_tooltip (StWidget *widget)
-{
- g_return_if_fail (ST_IS_WIDGET (widget));
-
- widget->priv->show_tooltip = FALSE;
- if (CLUTTER_ACTOR_IS_MAPPED (widget))
- st_widget_do_hide_tooltip (widget);
-}
-
-static void
-st_widget_do_hide_tooltip (StWidget *widget)
-{
- if (widget->priv->tooltip)
- clutter_actor_hide (CLUTTER_ACTOR (widget->priv->tooltip));
-}
-
/**
* st_widget_set_track_hover:
* @widget: A #StWidget
@@ -1870,7 +1543,7 @@ st_widget_set_track_hover (StWidget *widget,
* @widget: A #StWidget
*
* Returns the current value of the track-hover property. See
- * st_tooltip_set_track_hover() for more information.
+ * st_widget_set_track_hover() for more information.
*
* Returns: current value of track-hover on @widget
*/
@@ -1882,36 +1555,13 @@ st_widget_get_track_hover (StWidget *widget)
return widget->priv->track_hover;
}
-static gboolean
-tooltip_timeout (gpointer data)
-{
- st_widget_show_tooltip (data);
-
- return FALSE;
-}
-
-static void
-st_widget_start_tooltip_timeout (StWidget *widget)
-{
- StWidgetPrivate *priv = widget->priv;
- GtkSettings *settings = gtk_settings_get_default ();
- guint timeout;
-
- if (priv->tooltip_timeout_id)
- g_source_remove (priv->tooltip_timeout_id);
-
- g_object_get (settings, "gtk-tooltip-timeout", &timeout, NULL);
- priv->tooltip_timeout_id = g_timeout_add (timeout, tooltip_timeout, widget);
-}
-
/**
* st_widget_set_hover:
* @widget: A #StWidget
* @hover: whether the pointer is hovering over the widget
*
* Sets @widget's hover property and adds or removes "hover" from its
- * pseudo class accordingly. If #StWidget:has-tooltip is %TRUE, this
- * will also show or hide the tooltip, as appropriate.
+ * pseudo class accordingly.
*
* If you have set #StWidget:track-hover, you should not need to call
* this directly. You can call st_widget_sync_hover() if the hover
@@ -1931,25 +1581,9 @@ st_widget_set_hover (StWidget *widget,
{
priv->hover = hover;
if (priv->hover)
- {
- st_widget_add_style_pseudo_class (widget, "hover");
- if (priv->has_tooltip)
- st_widget_start_tooltip_timeout (widget);
- }
+ st_widget_add_style_pseudo_class (widget, "hover");
else
- {
- st_widget_remove_style_pseudo_class (widget, "hover");
- if (priv->has_tooltip)
- {
- if (priv->tooltip_timeout_id)
- {
- g_source_remove (priv->tooltip_timeout_id);
- priv->tooltip_timeout_id = 0;
- }
-
- st_widget_hide_tooltip (widget);
- }
- }
+ st_widget_remove_style_pseudo_class (widget, "hover");
g_object_notify (G_OBJECT (widget), "hover");
}
}
@@ -2180,18 +1814,17 @@ st_describe_actor (ClutterActor *actor)
if (name)
g_string_append_printf (desc, " \"%s\"", name);
- if (!append_actor_text (desc, actor) && CLUTTER_IS_CONTAINER (actor))
+ if (!append_actor_text (desc, actor))
{
GList *children, *l;
/* Do a limited search of @actor's children looking for a label */
- children = clutter_container_get_children (CLUTTER_CONTAINER (actor));
+ children = clutter_actor_get_children (actor);
for (l = children, i = 0; l && i < 20; l = l->next, i++)
{
if (append_actor_text (desc, l->data))
break;
- else if (CLUTTER_IS_CONTAINER (l->data))
- children = g_list_concat (children, clutter_container_get_children (l->data));
+ children = g_list_concat (children, clutter_actor_get_children ((ClutterActor *) l->data));
}
g_list_free (children);
}
@@ -2493,74 +2126,6 @@ on_can_focus_notify (GObject *gobject,
ATK_STATE_FOCUSABLE, can_focus);
}
-static GQuark
-st_ui_root_quark (void)
-{
- static GQuark value = 0;
- if (G_UNLIKELY (value == 0))
- value = g_quark_from_static_string ("st-ui-root");
- return value;
-}
-
-static void
-st_ui_root_destroyed (ClutterActor *actor,
- ClutterStage *stage)
-{
- st_set_ui_root (stage, NULL);
- g_signal_handlers_disconnect_by_func (actor, st_ui_root_destroyed, stage);
-}
-
-/**
- * st_set_ui_root:
- * @stage: a #ClutterStage
- * @container: (allow-none): the new UI root
- *
- * Sets a #ClutterContainer to be the parent of all UI in the program.
- * This container is used when St needs to add new content outside the
- * widget hierarchy, for example, when it shows a tooltip over a widget.
- */
-void
-st_set_ui_root (ClutterStage *stage,
- ClutterContainer *container)
-{
- ClutterContainer *previous;
-
- g_return_if_fail (CLUTTER_IS_STAGE (stage));
- g_return_if_fail (CLUTTER_IS_CONTAINER (container));
-
- previous = st_get_ui_root (stage);
- if (previous)
- g_signal_handlers_disconnect_by_func (container, st_ui_root_destroyed, stage);
-
- if (container)
- {
- g_signal_connect (container, "destroy", G_CALLBACK (st_ui_root_destroyed), stage);
- g_object_set_qdata_full (G_OBJECT (stage), st_ui_root_quark (), g_object_ref (container), g_object_unref);
- }
-}
-
-/**
- * st_get_ui_root:
- * @stage: a #ClutterStage
- *
- * Returns: (transfer none): the container which should be the parent of all user interface,
- * which can be set with st_set_ui_root(). If not set, returns @stage
- */
-ClutterContainer *
-st_get_ui_root (ClutterStage *stage)
-{
- ClutterContainer *root;
-
- g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
-
- root = g_object_get_qdata (G_OBJECT (stage), st_ui_root_quark ());
-
- if (root != NULL)
- return root;
- else
- return CLUTTER_CONTAINER (stage);
-}
-
static void
on_label_notify (GObject *gobject,
GParamSpec *pspec,
diff --git a/src/st/st-widget.h b/src/st/st-widget.h
index db8e162..ed1e508 100644
--- a/src/st/st-widget.h
+++ b/src/st/st-widget.h
@@ -119,16 +119,6 @@ void st_widget_set_theme (StWidget *acto
StTheme *theme);
StTheme * st_widget_get_theme (StWidget *actor);
-void st_widget_set_has_tooltip (StWidget *widget,
- gboolean has_tooltip);
-gboolean st_widget_get_has_tooltip (StWidget *widget);
-void st_widget_set_tooltip_text (StWidget *widget,
- const gchar *text);
-const gchar* st_widget_get_tooltip_text (StWidget *widget);
-
-void st_widget_show_tooltip (StWidget *widget);
-void st_widget_hide_tooltip (StWidget *widget);
-
void st_widget_set_track_hover (StWidget *widget,
gboolean track_hover);
gboolean st_widget_get_track_hover (StWidget *widget);
@@ -172,10 +162,6 @@ char *st_describe_actor (ClutterActor *actor);
void st_set_slow_down_factor (gfloat factor);
gfloat st_get_slow_down_factor (void);
-void st_set_ui_root (ClutterStage *stage,
- ClutterContainer *container);
-ClutterContainer *st_get_ui_root (ClutterStage *stage);
-
G_END_DECLS
#endif /* __ST_WIDGET_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]