~noskcaj/ubuntu/trusty/gnome-documents/3.10.2

« back to all changes in this revision

Viewing changes to src/utils.js

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Thomas Bechtold
  • Date: 2013-04-04 13:32:08 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130404133208-n19gqczi05z31ogb
Tags: 3.8.0-1
[ Thomas Bechtold ]
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
const Gtk = imports.gi.Gtk;
28
28
 
29
29
const Documents = imports.documents;
30
 
const Global = imports.global;
 
30
const Application = imports.application;
31
31
 
32
32
const Lang = imports.lang;
 
33
const Signals = imports.signals;
33
34
 
34
35
const _ICON_VIEW_SIZE = 128;
35
36
const _LIST_VIEW_SIZE = 48;
38
39
let debugEnabled = false;
39
40
 
40
41
function getIconSize() {
41
 
    let viewType = Global.settings.get_enum('view-as');
 
42
    let viewType = Application.settings.get_enum('view-as');
42
43
 
43
44
    if (viewType == Gd.MainViewType.LIST)
44
45
        return _LIST_VIEW_SIZE;
47
48
}
48
49
 
49
50
function getThumbnailFrameBorder() {
50
 
    let viewType = Global.settings.get_enum('view-as');
 
51
    let viewType = Application.settings.get_enum('view-as');
51
52
    let slice = new Gtk.Border();
52
53
    let border = null;
53
54
 
98
99
    return id;
99
100
}
100
101
 
101
 
function alphaGtkWidget(widget) {
102
 
    widget.override_background_color(0, new Gdk.RGBA({ red: 0,
103
 
                                                       green: 0,
104
 
                                                       blue: 0,
105
 
                                                       alpha: 0 }));
106
 
}
107
 
 
108
102
function debug(str) {
109
103
    if (!debugInit) {
110
104
        let env = GLib.getenv('DOCUMENTS_DEBUG');
117
111
    if (debugEnabled)
118
112
        log('DEBUG: ' + str);
119
113
}
 
114
 
 
115
function addJSSignalMethods(proto) {
 
116
    proto.connectJS = Signals._connect;
 
117
    proto.disconnectJS = Signals._disconnect;
 
118
    proto.emitJS = Signals._emit;
 
119
    proto.disconnectAllJS = Signals._disconnectAll;
 
120
}