~ubuntu-branches/ubuntu/utopic/gnome-control-center/utopic-proposed

« back to all changes in this revision

Viewing changes to panels/network/panel-cell-renderer-separator.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Sebastien Bacher, Robert Ancell, Iain Lane, Edward Donovan, Rico Tzschichholz, Jeremy Bicha, David Henningsson
  • Date: 2012-11-21 19:32:45 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20121121193245-mj61nzz1z4fk3z25
Tags: 1:3.6.3-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in: recommends libcanberra-pulse (lp: #1004973)
* debian/patches/58_ubuntu_icon_views_redesign.patch:
  - drop most of the changes, keep the different grid size though
    to fit on screen with our extra icons
* debian/patches/91_dont_show_in_unity.patch:
  - dropped, show the upstream printer panel and the layout tab
* debian/patches/revert_git_keyboard_gsettings.patch,
  debian/patches/revert_git_stop_using_gconf.patch:
  - dropped the gconf->gsettings reverts

[ Robert Ancell ]
* New upstream release (LP: #1010317)
* debian/control:
  - Bump build-depends on libgnome-desktop-3-dev, libwacom-dev
  - Add build-depends on libclutter-1.0-dev, libclutter-gtk-1.0-dev,
    libpwquality-dev
  - Drop build-depends on libgnomekbd-dev
* debian/patches/60_ubuntu_nav_bar.patch:
  - Disabled for now, doesn't apply
* debian/patches/revert_ua_gsettings.patch:
  - We can use GSettings for universal access now
* debian/patches/00git_online_accounts_gtkgrid.patch:
* debian/patches/00git_online_accounts_layout.part:
* debian/patches/git_wacom_translations.patch:
  - Applied upstream

[ Iain Lane ]
* Add Build-Depends on libxkbfile-dev
* New upstream release.
* Refresh all patches to apply cleanly.

[ Edward Donovan ]
* debian/source_gnome-control-center.py: Fix for Python 3. (LP: #1013171)

[ Rico Tzschichholz ]
* debian/control.in:
  - Build-depend on gtk-doc-tools instead of docbook directly
  - Bump minimum glib-2.0, gnome-desktop3, gnome-settings-daemon
     and gsettings-desktop-schemas

[ Jeremy Bicha ]
* Dropped more patches applied in new version:
  - git_unmute_sound_event.patch
  - git_fix_big_editable_labels.patch
  - 96_sound_nua_panel.patch
* debian/patches/04_new_appearance_settings.patch:
  - Dropped, this is now packaged separately as gnome-control-center-unity
* debian/patches/10_keyboard_layout_on_unity.patch:
  - Don't change the keyboard panel name when not running Unity
* debian/patches/52_ubuntu_language_list_mods.patch:
  - Don't disable adding current language to the list. While this
    fix shows the current language twice, at least it avoids the
    "Ubuntu suddenly in Chinese" bug (LP: #1035219)
* debian/patches/53_use_ubuntu_help.patch:
  - Only show Ubuntu help when running Unity
* debian/patches/58_hide_gdm_notifications.patch:
  - Hide "Show notifications when locked" settings when running Unity
    since it's a GNOME Shell-specific feature
* debian/patches/63_normal_scrollbar_in_a11y.patch:
  - Drop, overlay-scrollbars should handle this instead
* debian/patches/91_dont_show_in_unity.patch:
  - Hide Printers & Region panels in Unity until we're ready to switch
    to them.
* debian/patches/fix-crash-on-user-panel.patch:
  - Dropped, GNOME says it's obsolete
* debian/rules:
  - Build with -z,defs again
  - Explicitly disable ibus support since ibus 1.4 isn't supported in
    this version
* debian/control.in:
  - Drop ubuntu-docs and gnome-user-guide from recommends to suggests
  - Don't recommend indicators; let's leave that to Unity

[ David Henningsson ]
* sound_nua_panel.patch: Rebase to gnome 3.6 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Separator: C; tab-width: 8; indent-tabs-separator: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2012 Red Hat, Inc.
 
4
 *
 
5
 * Licensed under the GNU General Public License Version 2
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
20
 *
 
21
 * Written by Matthias Clasen
 
22
 */
 
23
 
 
24
#include "config.h"
 
25
 
 
26
#include <glib.h>
 
27
#include <glib/gi18n.h>
 
28
#include <gtk/gtk.h>
 
29
 
 
30
#include "panel-cell-renderer-separator.h"
 
31
 
 
32
enum {
 
33
        PROP_0,
 
34
        PROP_DRAW,
 
35
        PROP_LAST
 
36
};
 
37
 
 
38
G_DEFINE_TYPE (PanelCellRendererSeparator, panel_cell_renderer_separator, GTK_TYPE_CELL_RENDERER)
 
39
 
 
40
static void
 
41
panel_cell_renderer_separator_get_property (GObject    *object,
 
42
                                            guint       param_id,
 
43
                                            GValue     *value,
 
44
                                            GParamSpec *pspec)
 
45
{
 
46
        PanelCellRendererSeparator *renderer = PANEL_CELL_RENDERER_SEPARATOR (object);
 
47
 
 
48
        switch (param_id) {
 
49
        case PROP_DRAW:
 
50
                g_value_set_boolean (value, renderer->draw);
 
51
                break;
 
52
        default:
 
53
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
 
54
                break;
 
55
        }
 
56
}
 
57
 
 
58
static void
 
59
panel_cell_renderer_separator_set_property (GObject      *object,
 
60
                                            guint         param_id,
 
61
                                            const GValue *value,
 
62
                                            GParamSpec   *pspec)
 
63
{
 
64
        PanelCellRendererSeparator *renderer = PANEL_CELL_RENDERER_SEPARATOR (object);
 
65
 
 
66
        switch (param_id) {
 
67
        case PROP_DRAW:
 
68
                renderer->draw = g_value_get_boolean (value);
 
69
                break;
 
70
        default:
 
71
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
 
72
                break;
 
73
        }
 
74
}
 
75
 
 
76
static void
 
77
render (GtkCellRenderer      *cell,
 
78
        cairo_t              *cr,
 
79
        GtkWidget            *widget,
 
80
        const GdkRectangle   *background_area,
 
81
        const GdkRectangle   *cell_area,
 
82
        GtkCellRendererState  flags)
 
83
{
 
84
        PanelCellRendererSeparator *renderer = PANEL_CELL_RENDERER_SEPARATOR (cell);
 
85
        GtkStyleContext *context;
 
86
        gint x, y, w, h, xpad, ypad;
 
87
 
 
88
        if (!renderer->draw)
 
89
                return;
 
90
 
 
91
        context = gtk_widget_get_style_context (widget);
 
92
 
 
93
        gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
 
94
 
 
95
        x = cell_area->x + xpad;
 
96
        y = cell_area->y + ypad;
 
97
        w = cell_area->width - xpad * 2;
 
98
        h = cell_area->height - ypad * 2;
 
99
 
 
100
        gtk_render_line (context, cr, x + w / 2, y, x + w / 2, y + h - 1);
 
101
}
 
102
 
 
103
static void
 
104
panel_cell_renderer_separator_class_init (PanelCellRendererSeparatorClass *class)
 
105
{
 
106
        GObjectClass *object_class = G_OBJECT_CLASS (class);
 
107
        GtkCellRendererClass *cell_renderer_class = GTK_CELL_RENDERER_CLASS (class);
 
108
 
 
109
        object_class->get_property = panel_cell_renderer_separator_get_property;
 
110
        object_class->set_property = panel_cell_renderer_separator_set_property;
 
111
 
 
112
        cell_renderer_class->render = render;
 
113
 
 
114
        g_object_class_install_property (object_class, PROP_DRAW,
 
115
                                         g_param_spec_boolean ("draw", "draw", "draw",
 
116
                                                               TRUE,
 
117
                                                               G_PARAM_READWRITE));
 
118
}
 
119
 
 
120
static void
 
121
panel_cell_renderer_separator_init (PanelCellRendererSeparator *renderer)
 
122
{
 
123
        renderer->draw = TRUE;
 
124
}
 
125
 
 
126
GtkCellRenderer *
 
127
panel_cell_renderer_separator_new (void)
 
128
{
 
129
        return g_object_new (PANEL_TYPE_CELL_RENDERER_SEPARATOR, NULL);
 
130
}