Skip to content

Commit 2ed3758

Browse files
authored
v0.19.1
version 0.19.1
2 parents c59293d + a13a136 commit 2ed3758

14 files changed

+221
-4316
lines changed

poetry.lock

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyobs_gui/mainwindow.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from astroplan import Observer
66
from astropy.time import Time
77
from colour import Color
8+
import qtawesome as qta
89

910
from pyobs.comm import Comm, Proxy
1011
from pyobs.events import LogEvent, ModuleOpenedEvent, ModuleClosedEvent, Event
@@ -45,13 +46,14 @@
4546
}
4647

4748
DEFAULT_ICONS = {
48-
ICamera: ":/resources/Crystal_Clear_device_camera.png",
49-
ITelescope: ":/resources/Crystal_Clear_action_find.png",
50-
IRoof: ":/resources/Crystal_Clear_app_kfm_home.png",
51-
IFocuser: ":/resources/Crystal_Clear_app_demo.png",
52-
IWeather: ":/resources/Crystal_Clear_app_demo.png",
53-
IVideo: ":/resources/Crystal_Clear_device_camera.png",
54-
ISpectrograph: ":/resources/Crystal_Clear_device_camera.png",
49+
None: "fa5.question-circle",
50+
ICamera: "fa5s.camera",
51+
ITelescope: "msc.telescope",
52+
IRoof: "ph.house",
53+
IFocuser: "mdi.image-filter-center-focus",
54+
IWeather: "fa5s.cloud-sun",
55+
IVideo: "fa5s.video",
56+
ISpectrograph: "ei.graph",
5557
}
5658

5759

@@ -152,22 +154,22 @@ async def open(self, **kwargs: Any) -> None:
152154
if self.show_shell:
153155
# add shell nav button and view
154156
self.shell = self.create_widget(ShellWidget)
155-
await self._add_client("Shell", QtGui.QIcon(":/resources/Crystal_Clear_app_terminal.png"), self.shell, None)
157+
await self._add_client("Shell", qta.icon("msc.terminal-powershell"), self.shell, None)
156158
else:
157159
self.shell = None
158160

159161
# events
160162
if self.show_events:
161163
# add events nav button and view
162164
self.events = self.create_widget(EventsWidget)
163-
await self._add_client("Events", QtGui.QIcon(":/resources/Crystal_Clear_app_karm.png"), self.events, None)
165+
await self._add_client("Events", qta.icon("msc.symbol-event"), self.events, None)
164166
else:
165167
self.events = None
166168

167169
# status
168170
if self.show_status:
169171
self.status = self.create_widget(StatusWidget)
170-
await self._add_client("Status", QtGui.QIcon(":/resources/Crystal_Clear_app_demo.png"), self.status, None)
172+
await self._add_client("Status", qta.icon("fa5s.wifi"), self.status, None)
171173
else:
172174
self.status = None
173175

@@ -217,6 +219,7 @@ async def _add_client(
217219
item = PagesListWidgetItem()
218220
item.setIcon(icon)
219221
item.setText(client)
222+
item.setSizeHint(QtCore.QSize(80, 80))
220223

221224
# add to list and sort
222225
self.listPages.addItem(item)
@@ -346,14 +349,14 @@ async def _client_connected(self, event: Event, client: str) -> bool:
346349
for interface, klass in DEFAULT_WIDGETS.items():
347350
if isinstance(proxy, interface):
348351
widget = self.create_widget(klass, module=proxy)
349-
icon = QtGui.QIcon(DEFAULT_ICONS[interface])
352+
icon = qta.icon(DEFAULT_ICONS[interface])
350353
break
351354

352355
# look at custom widgets
353356
for cw in self.custom_widgets:
354357
if cw["module"] == client:
355358
widget = self.create_widget(cw["widget"], module=proxy)
356-
icon = QtGui.QIcon(list(DEFAULT_ICONS.values())[0])
359+
icon = qta.icon(DEFAULT_ICONS[None])
357360

358361
# still nothing?
359362
if widget is None:

pyobs_gui/qt/compile.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ for f in *widget.ui; do
33
echo "Processing $f file.."
44
pyuic5 --import-from=. "$f" | sed -E "s/(from (.*widget))/from \.\.\2/" > "${f%.ui}_ui.py"
55
done
6+
pyuic5 --import-from=. mainwindow.ui > mainwindow.py
7+
pyrcc5 resources.qrc > resources_rc.py

pyobs_gui/qt/mainwindow.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,20 @@ def setupUi(self, MainWindow):
117117
sizePolicy.setVerticalStretch(0)
118118
sizePolicy.setHeightForWidth(self.listPages.sizePolicy().hasHeightForWidth())
119119
self.listPages.setSizePolicy(sizePolicy)
120-
self.listPages.setMinimumSize(QtCore.QSize(100, 0))
121-
self.listPages.setMaximumSize(QtCore.QSize(100, 16777215))
120+
self.listPages.setMinimumSize(QtCore.QSize(84, 84))
121+
self.listPages.setMaximumSize(QtCore.QSize(84, 16777215))
122122
self.listPages.setFrameShape(QtWidgets.QFrame.NoFrame)
123123
self.listPages.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
124124
self.listPages.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
125125
self.listPages.setProperty("showDropIndicator", False)
126-
self.listPages.setDragDropMode(QtWidgets.QAbstractItemView.DragDrop)
126+
self.listPages.setDragDropMode(QtWidgets.QAbstractItemView.NoDragDrop)
127127
self.listPages.setDefaultDropAction(QtCore.Qt.IgnoreAction)
128-
self.listPages.setIconSize(QtCore.QSize(64, 64))
128+
self.listPages.setIconSize(QtCore.QSize(32, 32))
129129
self.listPages.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
130+
self.listPages.setMovement(QtWidgets.QListView.Static)
131+
self.listPages.setFlow(QtWidgets.QListView.LeftToRight)
130132
self.listPages.setViewMode(QtWidgets.QListView.IconMode)
133+
self.listPages.setSelectionRectVisible(False)
131134
self.listPages.setObjectName("listPages")
132135
self.horizontalLayout.addWidget(self.listPages)
133136
self.splitterToolBox = QtWidgets.QSplitter(self.layoutWidget)
@@ -173,6 +176,4 @@ def retranslateUi(self, MainWindow):
173176
MainWindow.setWindowTitle(_translate("MainWindow", "pyobs GUI"))
174177
self.labelAutonomousWarning.setText(_translate("MainWindow", "!!! WARNING: autonomous module(s) active !!!"))
175178
self.labelWeatherWarning.setText(_translate("MainWindow", "!!! WARNING: weather module disabled !!!"))
176-
177-
178179
from . import resources_rc

pyobs_gui/qt/mainwindow.ui

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@
278278
</property>
279279
<property name="minimumSize">
280280
<size>
281-
<width>100</width>
282-
<height>0</height>
281+
<width>84</width>
282+
<height>84</height>
283283
</size>
284284
</property>
285285
<property name="maximumSize">
286286
<size>
287-
<width>100</width>
287+
<width>84</width>
288288
<height>16777215</height>
289289
</size>
290290
</property>
@@ -301,23 +301,32 @@
301301
<bool>false</bool>
302302
</property>
303303
<property name="dragDropMode">
304-
<enum>QAbstractItemView::DragDrop</enum>
304+
<enum>QAbstractItemView::NoDragDrop</enum>
305305
</property>
306306
<property name="defaultDropAction">
307307
<enum>Qt::IgnoreAction</enum>
308308
</property>
309309
<property name="iconSize">
310310
<size>
311-
<width>64</width>
312-
<height>64</height>
311+
<width>32</width>
312+
<height>32</height>
313313
</size>
314314
</property>
315315
<property name="verticalScrollMode">
316316
<enum>QAbstractItemView::ScrollPerPixel</enum>
317317
</property>
318+
<property name="movement">
319+
<enum>QListView::Static</enum>
320+
</property>
321+
<property name="flow">
322+
<enum>QListView::LeftToRight</enum>
323+
</property>
318324
<property name="viewMode">
319325
<enum>QListView::IconMode</enum>
320326
</property>
327+
<property name="selectionRectVisible">
328+
<bool>false</bool>
329+
</property>
321330
</widget>
322331
</item>
323332
<item>

pyobs_gui/qt/resources.qrc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
<file>resources/arrow-alt-circle-right-solid.svg</file>
88
<file>resources/arrow-up-right-from-square-solid.svg</file>
99
<file>resources/undo-solid.svg</file>
10-
<file>resources/Crystal_Clear_app_kfm_home.png</file>
1110
<file>resources/edit-solid.svg</file>
12-
<file>resources/Crystal_Clear_device_camera.png</file>
13-
<file>resources/Crystal_Clear_app_terminal.png</file>
14-
<file>resources/Crystal_Clear_action_find.png</file>
15-
<file>resources/Crystal_Clear_app_demo.png</file>
16-
<file>resources/Crystal_Clear_app_karm.png</file>
1711
</qresource>
1812
</RCC>
-13.5 KB
Binary file not shown.
-16.3 KB
Binary file not shown.
-13.1 KB
Binary file not shown.
-8.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)