~rainct/screenruler/screenruler-gtk3

« back to all changes in this revision

Viewing changes to preferences_window.rb

  • Committer: Siegfried-Angel Gevatter Pujals
  • Date: 2011-09-03 19:33:22 UTC
  • Revision ID: siegfried@gevatter.com-20110903193322-g3u5xzcilzf97kyy
Start conversion to Gtk::Builder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
                # GTK signal handlers
32
32
                @window.signal_connect('delete_event') { hide }
33
33
 
34
 
                @system_ppi_setting_label.markup = sprintf("(%d x %d)", system_ppi_horizontal, system_ppi_vertical)
 
34
                @builder.get_object('system_ppi_setting_label').markup = sprintf("(%d x %d)", system_ppi_horizontal, system_ppi_vertical)
35
35
 
36
36
                on_key_press(Gdk::Keyval::GDK_Escape) { hide }
37
37
        end
38
38
 
39
 
        def foreground_color ; return @foreground_color_button.color ; end
40
 
        def background_color ; return @background_color_button.color ; end
41
 
        def font ; return @text_fontbutton.font_name ; end
42
 
        def watch_mouse? ; return @watch_mouse_checkbutton.active? ; end
43
 
        def watch_mouse=(value) ; @watch_mouse_checkbutton.active = value ; end
 
39
        def foreground_color ; return @builder.get_object('foreground_color_button').color ; end
 
40
        def background_color ; return @builder.get_object('background_color_button').color ; end
 
41
        def font ; return @builder.get_object('text_fontbutton').font_name ; end
 
42
        def watch_mouse? ; return @builder.get_object('watch_mouse_checkbutton').active? ; end
 
43
        def watch_mouse=(value) ; @builder.get_object('watch_mouse_checkbutton').active = value ; end
44
44
        attr_reader :opacity
45
45
 
46
46
        def ppi_horizontal
47
 
                if @use_custom_ppi_radiobutton.active?
48
 
                        @ppi_horizontal_spinbutton.value
 
47
                if @builder.get_object('use_custom_ppi_radiobutton').active?
 
48
                        @builder.get_object('ppi_horizontal_spinbutton').value
49
49
                else
50
50
                        system_ppi_horizontal
51
51
                end
52
52
        end
53
53
 
54
54
        def ppi_vertical
55
 
                if @use_custom_ppi_radiobutton.active?
56
 
                        @ppi_vertical_spinbutton.value
 
55
                if @builder.get_object('use_custom_ppi_radiobutton').active?
 
56
                        @builder.get_object('ppi_vertical_spinbutton').value
57
57
                else
58
58
                        system_ppi_vertical
59
59
                end