~rainct/screenruler/screenruler-gtk3

« back to all changes in this revision

Viewing changes to ruler_window.rb

  • Committer: Ian McIntosh
  • Date: 2011-08-12 20:13:24 UTC
  • Revision ID: ian@openanswers.org-20110812201324-t35xgp0l97akhivq
- add gettext support and .pot file

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        MOVE_SMALL, MOVE_LARGE = 1, 15
27
27
        GROW_SMALL, GROW_LARGE = 1, 15
28
28
 
29
 
        ORIENTATION_LEFT, ORIENTATION_UP = 'left', 'up'         # where the value '0 pixels' isutils/unique_timeout.rb
 
29
        ORIENTATION_LEFT, ORIENTATION_UP = 'left', 'up'         # where the value '0 pixels' is
30
30
 
31
31
        MENU_BOX_WIDTH, MENU_BOX_HEIGHT = 10, 10
32
32
        MENU_BOX_RELIEF = 10                                                                                                                    # distance from edge
36
36
        MEASUREMENT_TOOLTIP_UPDATE_FREQUENCY = 80                                       # in milliseconds
37
37
 
38
38
        @@unit_settings = {
39
 
                UNIT_INCHES                             => Unit.new('in', 'MMMLMMML',                   1,      1),
40
 
                UNIT_CENTIMETERS        => Unit.new('cm', 'MMMMLMMMML',         1,      0.3937),
41
 
                UNIT_PICAS                              => Unit.new('pc', 'MMLMML',                     6,      0.1667),
42
 
                UNIT_POINTS                             => Unit.new('pt', 'MMMMMLMMMMML',       72,     0.0139),
43
 
                UNIT_PIXELS                             => Unit.new('px', 'SSSSMSSSSMSSSSMSSSSMSSSSL' * 2, 100, -1),    # :per_inch not used...
44
 
                UNIT_PERCENTAGE         => Unit.new('%',  'ML',                                         10,     -1)                                                                                     # ...ditto
 
39
                UNIT_INCHES                             => Unit.new(_('in'), 'MMMLMMML',                        1,      1),
 
40
                UNIT_CENTIMETERS        => Unit.new(_('cm'), 'MMMMLMMMML',      1,      0.3937),
 
41
                UNIT_PICAS                              => Unit.new(_('pc'), 'MMLMML',                  6,      0.1667),
 
42
                UNIT_POINTS                             => Unit.new(_('pt'), 'MMMMMLMMMMML',    72,     0.0139),
 
43
                UNIT_PIXELS                             => Unit.new(_('px'), 'SSSSMSSSSMSSSSMSSSSMSSSSL' * 2, 100, -1), # :per_inch not used...
 
44
                UNIT_PERCENTAGE         => Unit.new(_('%'),  'ML',                                              10,     -1)                                                                                     # ...ditto
45
45
        }.freeze
46
46
 
47
47
        @@tick_sizes = {'S' => 4, 'M' => 7, 'L' => 10}.freeze           # length of tick marks (in pixels) in above patterns