Browse Source

interface design adjustments

bmallred 12 years ago
parent
commit
8c1795ff3d
2 changed files with 140 additions and 26 deletions
  1. 124 25
      data/ui/OrganiccodeWindow.ui
  2. 16 1
      organiccode/OrganiccodeWindow.py

+ 124 - 25
data/ui/OrganiccodeWindow.ui

@ -3,6 +3,7 @@
3 3
  <!-- interface-requires gtk+ 3.0 -->
4 4
  <!-- interface-requires organiccode_window 1.0 -->
5 5
  <!-- interface-local-resource-path ../media -->
6
  <object class="GtkAction" id="action1"/>
6 7
  <object class="GtkAdjustment" id="heightAdjustment">
7 8
    <property name="lower">100</property>
8 9
    <property name="upper">9999</property>
@ -23,7 +24,7 @@
23 24
    <property name="page_increment">10</property>
24 25
  </object>
25 26
  <object class="OrganiccodeWindow" id="organiccode_window">
26
    <property name="width_request">600</property>
27
    <property name="width_request">400</property>
27 28
    <property name="height_request">350</property>
28 29
    <property name="can_focus">False</property>
29 30
    <property name="title" translatable="yes">Organiccode</property>
@ -32,7 +33,6 @@
32 33
      <object class="GtkVBox" id="vbox1">
33 34
        <property name="visible">True</property>
34 35
        <property name="can_focus">False</property>
35
        <property name="spacing">10</property>
36 36
        <child>
37 37
          <object class="GtkMenuBar" id="menubar1">
38 38
            <property name="visible">True</property>
@ -101,32 +101,97 @@
101 101
            <property name="position">0</property>
102 102
          </packing>
103 103
        </child>
104
        <child>
105
          <object class="GtkToolbar" id="toolbar">
106
            <property name="visible">True</property>
107
            <property name="can_focus">False</property>
108
            <property name="toolbar_style">both</property>
109
            <child>
110
              <object class="GtkToolButton" id="generateButton">
111
                <property name="use_action_appearance">False</property>
112
                <property name="related_action">action1</property>
113
                <property name="visible">True</property>
114
                <property name="can_focus">False</property>
115
                <property name="tooltip_text" translatable="yes">Render the current repository</property>
116
                <property name="label" translatable="yes">Generate</property>
117
                <property name="use_underline">True</property>
118
                <property name="stock_id">gtk-apply</property>
119
              </object>
120
              <packing>
121
                <property name="expand">False</property>
122
                <property name="homogeneous">True</property>
123
              </packing>
124
            </child>
125
            <child>
126
              <object class="GtkToolButton" id="aboutButton">
127
                <property name="use_action_appearance">False</property>
128
                <property name="related_action">action1</property>
129
                <property name="visible">True</property>
130
                <property name="can_focus">False</property>
131
                <property name="tooltip_text" translatable="yes">Information about the program</property>
132
                <property name="label" translatable="yes">About</property>
133
                <property name="use_underline">True</property>
134
                <property name="stock_id">gtk-about</property>
135
              </object>
136
              <packing>
137
                <property name="expand">False</property>
138
                <property name="homogeneous">True</property>
139
              </packing>
140
            </child>
141
            <child>
142
              <object class="GtkToolButton" id="exitButton">
143
                <property name="use_action_appearance">False</property>
144
                <property name="related_action">action1</property>
145
                <property name="visible">True</property>
146
                <property name="can_focus">False</property>
147
                <property name="tooltip_text" translatable="yes">Exit</property>
148
                <property name="label" translatable="yes">Close</property>
149
                <property name="use_underline">True</property>
150
                <property name="stock_id">gtk-cancel</property>
151
              </object>
152
              <packing>
153
                <property name="expand">False</property>
154
                <property name="homogeneous">True</property>
155
              </packing>
156
            </child>
157
          </object>
158
          <packing>
159
            <property name="expand">False</property>
160
            <property name="fill">True</property>
161
            <property name="position">1</property>
162
          </packing>
163
        </child>
104 164
        <child>
105 165
          <object class="GtkBox" id="box1">
106 166
            <property name="visible">True</property>
107 167
            <property name="can_focus">False</property>
168
            <property name="margin_left">5</property>
169
            <property name="margin_right">5</property>
170
            <property name="margin_top">5</property>
171
            <property name="margin_bottom">5</property>
108 172
            <child>
109
              <object class="GtkFileChooserButton" id="projectFolder">
173
              <object class="GtkLabel" id="label7">
110 174
                <property name="visible">True</property>
111 175
                <property name="can_focus">False</property>
112
                <property name="orientation">vertical</property>
113
                <property name="action">select-folder</property>
114
                <property name="create_folders">False</property>
115
                <property name="preview_widget_active">False</property>
116
                <property name="use_preview_label">False</property>
176
                <property name="margin_right">10</property>
177
                <property name="label" translatable="yes">Project directory</property>
117 178
              </object>
118 179
              <packing>
119
                <property name="expand">True</property>
180
                <property name="expand">False</property>
120 181
                <property name="fill">True</property>
121 182
                <property name="position">0</property>
122 183
              </packing>
123 184
            </child>
124 185
            <child>
125
              <object class="GtkButton" id="generateButton">
126
                <property name="label" translatable="yes">Generate</property>
186
              <object class="GtkFileChooserButton" id="projectFolder">
127 187
                <property name="visible">True</property>
128
                <property name="can_focus">True</property>
129
                <property name="receives_default">True</property>
188
                <property name="can_focus">False</property>
189
                <property name="tooltip_text" translatable="yes">Path to the version control repository</property>
190
                <property name="orientation">vertical</property>
191
                <property name="action">select-folder</property>
192
                <property name="create_folders">False</property>
193
                <property name="preview_widget_active">False</property>
194
                <property name="use_preview_label">False</property>
130 195
              </object>
131 196
              <packing>
132 197
                <property name="expand">True</property>
@ -138,7 +203,7 @@
138 203
          <packing>
139 204
            <property name="expand">False</property>
140 205
            <property name="fill">True</property>
141
            <property name="position">1</property>
206
            <property name="position">2</property>
142 207
          </packing>
143 208
        </child>
144 209
        <child>
@ -154,10 +219,17 @@
154 219
                  <object class="GtkExpander" id="expander1">
155 220
                    <property name="visible">True</property>
156 221
                    <property name="can_focus">True</property>
222
                    <property name="margin_left">5</property>
223
                    <property name="margin_right">5</property>
224
                    <property name="margin_top">5</property>
225
                    <property name="margin_bottom">5</property>
226
                    <property name="spacing">5</property>
157 227
                    <child>
158 228
                      <object class="GtkGrid" id="grid1">
159 229
                        <property name="visible">True</property>
160 230
                        <property name="can_focus">False</property>
231
                        <property name="row_homogeneous">True</property>
232
                        <property name="column_homogeneous">True</property>
161 233
                        <child>
162 234
                          <object class="GtkCheckButton" id="fullScreen">
163 235
                            <property name="label" translatable="yes">Full Screen</property>
@ -178,6 +250,7 @@
178 250
                          <object class="GtkBox" id="box4">
179 251
                            <property name="visible">True</property>
180 252
                            <property name="can_focus">False</property>
253
                            <property name="homogeneous">True</property>
181 254
                            <child>
182 255
                              <object class="GtkLabel" id="label4">
183 256
                                <property name="visible">True</property>
@ -217,6 +290,7 @@
217 290
                          <object class="GtkBox" id="box5">
218 291
                            <property name="visible">True</property>
219 292
                            <property name="can_focus">False</property>
293
                            <property name="homogeneous">True</property>
220 294
                            <child>
221 295
                              <object class="GtkLabel" id="label5">
222 296
                                <property name="visible">True</property>
@ -301,6 +375,7 @@
301 375
                      <object class="GtkLabel" id="label1">
302 376
                        <property name="visible">True</property>
303 377
                        <property name="can_focus">False</property>
378
                        <property name="margin_left">10</property>
304 379
                        <property name="label" translatable="yes">Screen</property>
305 380
                      </object>
306 381
                    </child>
@ -315,10 +390,17 @@
315 390
                  <object class="GtkExpander" id="expander2">
316 391
                    <property name="visible">True</property>
317 392
                    <property name="can_focus">True</property>
393
                    <property name="margin_left">5</property>
394
                    <property name="margin_right">5</property>
395
                    <property name="margin_top">5</property>
396
                    <property name="margin_bottom">5</property>
397
                    <property name="spacing">5</property>
318 398
                    <child>
319 399
                      <object class="GtkGrid" id="grid2">
320 400
                        <property name="visible">True</property>
321 401
                        <property name="can_focus">False</property>
402
                        <property name="row_homogeneous">True</property>
403
                        <property name="column_homogeneous">True</property>
322 404
                        <child>
323 405
                          <object class="GtkCheckButton" id="startPosition">
324 406
                            <property name="label" translatable="yes">Start position</property>
@ -414,6 +496,7 @@
414 496
                      <object class="GtkLabel" id="label3">
415 497
                        <property name="visible">True</property>
416 498
                        <property name="can_focus">False</property>
499
                        <property name="margin_left">10</property>
417 500
                        <property name="label" translatable="yes">Timeline</property>
418 501
                      </object>
419 502
                    </child>
@ -428,16 +511,17 @@
428 511
                  <object class="GtkExpander" id="expander3">
429 512
                    <property name="visible">True</property>
430 513
                    <property name="can_focus">True</property>
514
                    <property name="margin_left">5</property>
515
                    <property name="margin_right">5</property>
516
                    <property name="margin_top">5</property>
517
                    <property name="margin_bottom">5</property>
518
                    <property name="spacing">5</property>
431 519
                    <child>
432 520
                      <object class="GtkGrid" id="grid3">
433 521
                        <property name="visible">True</property>
434 522
                        <property name="can_focus">False</property>
435
                        <child>
436
                          <placeholder/>
437
                        </child>
438
                        <child>
439
                          <placeholder/>
440
                        </child>
523
                        <property name="row_homogeneous">True</property>
524
                        <property name="column_homogeneous">True</property>
441 525
                        <child>
442 526
                          <object class="GtkCheckButton" id="key">
443 527
                            <property name="label" translatable="yes">File extension key</property>
@ -502,12 +586,19 @@
502 586
                            <property name="height">1</property>
503 587
                          </packing>
504 588
                        </child>
589
                        <child>
590
                          <placeholder/>
591
                        </child>
592
                        <child>
593
                          <placeholder/>
594
                        </child>
505 595
                      </object>
506 596
                    </child>
507 597
                    <child type="label">
508 598
                      <object class="GtkLabel" id="label2">
509 599
                        <property name="visible">True</property>
510 600
                        <property name="can_focus">False</property>
601
                        <property name="margin_left">10</property>
511 602
                        <property name="label" translatable="yes">Options</property>
512 603
                      </object>
513 604
                    </child>
@ -522,10 +613,17 @@
522 613
                  <object class="GtkExpander" id="expander4">
523 614
                    <property name="visible">True</property>
524 615
                    <property name="can_focus">True</property>
616
                    <property name="margin_left">5</property>
617
                    <property name="margin_right">5</property>
618
                    <property name="margin_top">5</property>
619
                    <property name="margin_bottom">5</property>
620
                    <property name="spacing">5</property>
525 621
                    <child>
526 622
                      <object class="GtkGrid" id="grid4">
527 623
                        <property name="visible">True</property>
528 624
                        <property name="can_focus">False</property>
625
                        <property name="row_homogeneous">True</property>
626
                        <property name="column_homogeneous">True</property>
529 627
                        <child>
530 628
                          <object class="GtkCheckButton" id="hideBloom">
531 629
                            <property name="label" translatable="yes">Bloom</property>
@ -574,9 +672,6 @@
574 672
                            <property name="height">1</property>
575 673
                          </packing>
576 674
                        </child>
577
                        <child>
578
                          <placeholder/>
579
                        </child>
580 675
                        <child>
581 676
                          <object class="GtkCheckButton" id="hideFiles">
582 677
                            <property name="label" translatable="yes">Files</property>
@ -705,12 +800,16 @@
705 800
                            <property name="height">1</property>
706 801
                          </packing>
707 802
                        </child>
803
                        <child>
804
                          <placeholder/>
805
                        </child>
708 806
                      </object>
709 807
                    </child>
710 808
                    <child type="label">
711 809
                      <object class="GtkLabel" id="label6">
712 810
                        <property name="visible">True</property>
713 811
                        <property name="can_focus">False</property>
812
                        <property name="margin_left">10</property>
714 813
                        <property name="label" translatable="yes">Hidden Elements</property>
715 814
                      </object>
716 815
                    </child>
@ -732,7 +831,7 @@
732 831
          <packing>
733 832
            <property name="expand">True</property>
734 833
            <property name="fill">True</property>
735
            <property name="position">2</property>
834
            <property name="position">3</property>
736 835
          </packing>
737 836
        </child>
738 837
        <child>
@ -760,7 +859,7 @@
760 859
            <property name="expand">False</property>
761 860
            <property name="fill">True</property>
762 861
            <property name="pack_type">end</property>
763
            <property name="position">3</property>
862
            <property name="position">4</property>
764 863
          </packing>
765 864
        </child>
766 865
      </object>

+ 16 - 1
organiccode/OrganiccodeWindow.py

@ -39,7 +39,6 @@ class OrganiccodeWindow(Window):
39 39
        # Code for other initialization actions should be added here.
40 40
        self.openMenu = self.builder.get_object("mnu_open")
41 41
        self.projectFolder = self.builder.get_object("projectFolder")
42
        self.generateButton = self.builder.get_object("generateButton")
43 42
        self.fullScreen = self.builder.get_object("fullScreen")
44 43
        self.multiSampling = self.builder.get_object("multiSampling")
45 44
        self.noVsync = self.builder.get_object("noVsync")
@ -53,6 +52,12 @@ class OrganiccodeWindow(Window):
53 52
        self.loop = self.builder.get_object("loop")
54 53
        self.status = self.builder.get_object("status")
55 54
55
        self.toolbar = self.builder.get_object("toolbar")
56
        self.generateButton = self.builder.get_object("generateButton")
57
        self.exitButton = self.builder.get_object("exitButton")
58
        self.aboutButton = self.builder.get_object("aboutButton")
59
        self.mnu_about = self.builder.get_object("mnu_about")
60
56 61
        self.key = self.builder.get_object("key")
57 62
        self.highlightUsers = self.builder.get_object("highlightUsers")
58 63
        self.highlightDirs = self.builder.get_object("highlightDirs")
@ -70,9 +75,19 @@ class OrganiccodeWindow(Window):
70 75
        self.hideUsers = self.builder.get_object("hideUsers")
71 76
        self.hideUsernames = self.builder.get_object("hideUsernames")
72 77
78
        # Style the toolbar.
79
        context = self.toolbar.get_style_context()
80
        context.add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
81
73 82
    def on_openMenu_clicked(self, widget):
74 83
        self.projectFolder.click()
75 84
85
    def on_exitButton_clicked(self, widget):
86
        exit()
87
88
    def on_aboutButton_clicked(self, widget):
89
        self.mnu_about.activate()
90
76 91
    def on_generateButton_clicked(self, widget):
77 92
        self.status.set_label("Building parameters...")
78 93