Skip to content

Commit 5725c61

Browse files
committed
Consolidate with Windows
1 parent 5a7dd35 commit 5725c61

File tree

4 files changed

+465
-120
lines changed

4 files changed

+465
-120
lines changed

src/Interface/Application/Module.ui

Lines changed: 132 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>245</width>
10-
<height>68</height>
9+
<width>258</width>
10+
<height>87</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -43,118 +43,7 @@
4343
<layout class="QVBoxLayout" name="verticalLayout">
4444
<item>
4545
<layout class="QGridLayout" name="gridLayout">
46-
<item row="1" column="4">
47-
<widget class="QPushButton" name="optionsButton_">
48-
<property name="sizePolicy">
49-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
50-
<horstretch>0</horstretch>
51-
<verstretch>0</verstretch>
52-
</sizepolicy>
53-
</property>
54-
<property name="minimumSize">
55-
<size>
56-
<width>40</width>
57-
<height>23</height>
58-
</size>
59-
</property>
60-
<property name="maximumSize">
61-
<size>
62-
<width>40</width>
63-
<height>23</height>
64-
</size>
65-
</property>
66-
<property name="toolTip">
67-
<string>Module-specific options</string>
68-
</property>
69-
<property name="whatsThis">
70-
<string>Click this button to open the module's options dialog.</string>
71-
</property>
72-
<property name="text">
73-
<string>UI</string>
74-
</property>
75-
</widget>
76-
</item>
77-
<item row="0" column="3">
78-
<spacer name="horizontalSpacer_2">
79-
<property name="orientation">
80-
<enum>Qt::Horizontal</enum>
81-
</property>
82-
<property name="sizeType">
83-
<enum>QSizePolicy::Fixed</enum>
84-
</property>
85-
<property name="sizeHint" stdset="0">
86-
<size>
87-
<width>20</width>
88-
<height>23</height>
89-
</size>
90-
</property>
91-
</spacer>
92-
</item>
93-
<item row="1" column="3">
94-
<widget class="QPushButton" name="helpButton_">
95-
<property name="sizePolicy">
96-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
97-
<horstretch>0</horstretch>
98-
<verstretch>0</verstretch>
99-
</sizepolicy>
100-
</property>
101-
<property name="minimumSize">
102-
<size>
103-
<width>23</width>
104-
<height>23</height>
105-
</size>
106-
</property>
107-
<property name="maximumSize">
108-
<size>
109-
<width>23</width>
110-
<height>23</height>
111-
</size>
112-
</property>
113-
<property name="toolTip">
114-
<string>Launch Documentation Browser</string>
115-
</property>
116-
<property name="whatsThis">
117-
<string>Click this button to launch the module's help page in your browser.</string>
118-
</property>
119-
<property name="text">
120-
<string>?</string>
121-
</property>
122-
</widget>
123-
</item>
124-
<item row="0" column="0">
125-
<widget class="QLabel" name="titleLabel_">
126-
<property name="sizePolicy">
127-
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
128-
<horstretch>3</horstretch>
129-
<verstretch>0</verstretch>
130-
</sizepolicy>
131-
</property>
132-
<property name="minimumSize">
133-
<size>
134-
<width>75</width>
135-
<height>27</height>
136-
</size>
137-
</property>
138-
<property name="font">
139-
<font>
140-
<family>Segoe UI</family>
141-
<pointsize>8</pointsize>
142-
<weight>75</weight>
143-
<bold>true</bold>
144-
</font>
145-
</property>
146-
<property name="whatsThis">
147-
<string>Title of the module.</string>
148-
</property>
149-
<property name="lineWidth">
150-
<number>-4</number>
151-
</property>
152-
<property name="text">
153-
<string>&lt;b&gt;&lt;h3&gt;ModuleTitle&lt;/h3&gt;&lt;/b&gt;</string>
154-
</property>
155-
</widget>
156-
</item>
157-
<item row="1" column="1">
46+
<item row="2" column="1">
15847
<widget class="QPushButton" name="logButton2_">
15948
<property name="sizePolicy">
16049
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -251,7 +140,20 @@
251140
</property>
252141
</widget>
253142
</item>
254-
<item row="1" column="0">
143+
<item row="2" column="2">
144+
<spacer name="horizontalSpacer_Mac2">
145+
<property name="orientation">
146+
<enum>Qt::Horizontal</enum>
147+
</property>
148+
<property name="sizeHint" stdset="0">
149+
<size>
150+
<width>2</width>
151+
<height>20</height>
152+
</size>
153+
</property>
154+
</spacer>
155+
</item>
156+
<item row="2" column="0">
255157
<widget class="QProgressBar" name="progressBar_">
256158
<property name="sizePolicy">
257159
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -301,15 +203,126 @@
301203
</property>
302204
</spacer>
303205
</item>
304-
<item row="1" column="2">
305-
<spacer name="horizontalSpacer_Mac2">
206+
<item row="0" column="0">
207+
<widget class="QLabel" name="titleLabel_">
208+
<property name="sizePolicy">
209+
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
210+
<horstretch>3</horstretch>
211+
<verstretch>0</verstretch>
212+
</sizepolicy>
213+
</property>
214+
<property name="minimumSize">
215+
<size>
216+
<width>75</width>
217+
<height>27</height>
218+
</size>
219+
</property>
220+
<property name="font">
221+
<font>
222+
<family>Segoe UI</family>
223+
<pointsize>8</pointsize>
224+
<weight>75</weight>
225+
<bold>true</bold>
226+
</font>
227+
</property>
228+
<property name="whatsThis">
229+
<string>Title of the module.</string>
230+
</property>
231+
<property name="lineWidth">
232+
<number>-4</number>
233+
</property>
234+
<property name="text">
235+
<string>&lt;b&gt;&lt;h3&gt;ModuleTitle&lt;/h3&gt;&lt;/b&gt;</string>
236+
</property>
237+
</widget>
238+
</item>
239+
<item row="2" column="4">
240+
<widget class="QPushButton" name="optionsButton_">
241+
<property name="sizePolicy">
242+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
243+
<horstretch>0</horstretch>
244+
<verstretch>0</verstretch>
245+
</sizepolicy>
246+
</property>
247+
<property name="minimumSize">
248+
<size>
249+
<width>40</width>
250+
<height>23</height>
251+
</size>
252+
</property>
253+
<property name="maximumSize">
254+
<size>
255+
<width>40</width>
256+
<height>23</height>
257+
</size>
258+
</property>
259+
<property name="toolTip">
260+
<string>Module-specific options</string>
261+
</property>
262+
<property name="whatsThis">
263+
<string>Click this button to open the module's options dialog.</string>
264+
</property>
265+
<property name="text">
266+
<string>UI</string>
267+
</property>
268+
</widget>
269+
</item>
270+
<item row="0" column="3">
271+
<spacer name="horizontalSpacer_2">
306272
<property name="orientation">
307273
<enum>Qt::Horizontal</enum>
308274
</property>
275+
<property name="sizeType">
276+
<enum>QSizePolicy::Fixed</enum>
277+
</property>
309278
<property name="sizeHint" stdset="0">
310279
<size>
311-
<width>2</width>
312-
<height>20</height>
280+
<width>20</width>
281+
<height>23</height>
282+
</size>
283+
</property>
284+
</spacer>
285+
</item>
286+
<item row="2" column="3">
287+
<widget class="QPushButton" name="helpButton_">
288+
<property name="sizePolicy">
289+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
290+
<horstretch>0</horstretch>
291+
<verstretch>0</verstretch>
292+
</sizepolicy>
293+
</property>
294+
<property name="minimumSize">
295+
<size>
296+
<width>23</width>
297+
<height>23</height>
298+
</size>
299+
</property>
300+
<property name="maximumSize">
301+
<size>
302+
<width>23</width>
303+
<height>23</height>
304+
</size>
305+
</property>
306+
<property name="toolTip">
307+
<string>Launch Documentation Browser</string>
308+
</property>
309+
<property name="whatsThis">
310+
<string>Click this button to launch the module's help page in your browser.</string>
311+
</property>
312+
<property name="text">
313+
<string>?</string>
314+
</property>
315+
</widget>
316+
</item>
317+
<item row="1" column="0">
318+
<spacer name="verticalSpacer_Mac">
319+
<property name="orientation">
320+
<enum>Qt::Vertical</enum>
321+
</property>
322+
<property name="sizeHint" stdset="0">
323+
<size>
324+
<width>20</width>
325+
<height>5</height>
313326
</size>
314327
</property>
315328
</spacer>

src/Interface/Application/ModuleWidget.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ namespace
210210
const int extraWidthThreshold = 5;
211211
const int smushFactor = 15;
212212
const int titleFontSize = 8;
213-
const int widgetHeightAdjust = 0;
213+
const int widgetHeightAdjust = -20;
214214
#else
215215
const int moduleWidthThreshold = 80;
216216
const int extraModuleWidth = 5;
@@ -281,6 +281,13 @@ ModuleWidget::ModuleWidget(NetworkEditor* ed, const QString& name, SCIRun::Dataf
281281
resize(width() - smushFactor, height());
282282
//std::cout << "\tNew width: " << width() << std::endl;
283283
}
284+
285+
//TODO: centralize platform-dependent code
286+
#ifdef WIN32
287+
layout()->removeItem(verticalSpacer_Mac);
288+
layout()->removeItem(horizontalSpacer_Mac1);
289+
layout()->removeItem(horizontalSpacer_Mac2);
290+
#endif
284291
resize(width(), height() + widgetHeightAdjust);
285292

286293
connect(optionsButton_, SIGNAL(clicked()), this, SLOT(toggleOptionsDialog()));
File renamed without changes.

0 commit comments

Comments
 (0)