Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.ar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# سجل التغييرات

## 0.30.3
- **انقر بالزر الأيمن على زر في شريط الأدوات لتصل إلى إعداداته.** يعرض كل زر عنصراً واحداً يفتح
الإعدادات عند خياراته مباشرة: السمة ← **المظهر**، لقطة شاشة ← **الملفات ← لقطات الشاشة**، فتح في
برنامج التقطيع ← **برنامج التقطيع**، تصدير STL ← **الملفات ← تصدير STL**، اللوحة ← **العارض ← لوحة
الطباعة**، وفحص والعرض وقياس ← **العارض ← القياس والعرض والفحص**. أما زر الإعدادات والرئيسية وفتح
وملاءمة والمكان الفارغ في شريط الأدوات فتعرض **تخصيص شريط الأدوات…**.
[شاهد الجدول](https://sevagjb.github.io/PrintView3D/ar/use.html#toolbar-buttons).
- **مُصلح: كانت الإعدادات تُفتح بأحجام مختلفة.** عند فتحها من تخصيص شريط الأدوات أو التحديثات أو حول
كانت أضيق منها عند فتحها من زر الإعدادات، فيظهر عمودا مربع **لوحة الطباعة** في صفحة العارض أحدهما
تحت الآخر. وهي الآن تُفتح بالحجم نفسه من أي مكان.
- **مُصلح: صفوف مربع لوحة الطباعة لم تكن متحاذية**: كان *اللوحة* و*حجم اللوحة* أعلى ببضع نقاط من
*خطوط الشبكة كل* و*الخطوط الرئيسية كل* المجاورة لهما.

## 0.30.2
- **أكثر أماناً مع الملفات القادمة من الإنترنت.** أظهرت مراجعة للكود أربع طرق يمكن بها لملف مصنوع
بقصد الإضرار أن يسيء استخدام PrintView3D، وقد أُغلقت الأربع كلها:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.30.3
- **Right-click a toolbar button for its settings.** Each button offers one item that opens Settings
right at its own options: Theme → **Appearance**, Screenshot → **Files → Screenshots**, Open in
slicer → **Slicer**, Export STL → **Files → Export STL**, Plate → **Viewer → Build plate**, and
Check, View and Measure → **Viewer → Measure, View and Check**. The Settings gear, Home, Open, Fit
and an empty spot on the toolbar offer **Customize toolbar…**.
[See the table](https://sevagjb.github.io/PrintView3D/use.html#toolbar-buttons).
- **Fixed: Settings opened at different sizes.** Opened from Customize toolbar, Updates or About it
came out narrower than from the Settings button, and the **Build plate** box on the Viewer page
then showed its two columns one under the other. It now opens at the same size from everywhere.
- **Fixed: the rows of the Build plate box didn't line up**: *Plate* and *Plate size* sat a few pixels
higher than *Grid lines every* and *Main grid lines every* beside them.

## 0.30.2
- **Safer with files from the internet.** A review of the code found four ways a file made to harm
could misuse PrintView3D; all four are closed:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.nl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.30.3
- **Klik met rechts op een knop op de werkbalk voor zijn instellingen.** Elke knop biedt één item dat
Instellingen meteen bij zijn eigen opties opent: Thema → **Uiterlijk**, Schermafbeelding →
**Bestanden → Schermafbeeldingen**, Openen in slicer → **Slicer**, STL exporteren → **Bestanden →
STL exporteren**, Plaat → **Weergave → Printplaat**, en Controleren, Weergave en Meten →
**Weergave → Meten, weergave en controleren**. Het tandwiel van Instellingen, Start, Openen, Passend
en een lege plek op de werkbalk bieden **Werkbalk aanpassen…**.
[Bekijk de tabel](https://sevagjb.github.io/PrintView3D/nl/use.html#toolbar-buttons).
- **Opgelost: Instellingen opende in verschillende groottes.** Geopend vanuit Werkbalk aanpassen,
Updates of Over was het venster smaller dan vanuit de knop Instellingen, en dan stonden de twee
kolommen van het vak **Printplaat** op de pagina Weergave onder elkaar. Het opent nu overal even
groot.
- **Opgelost: de rijen van het vak Printplaat stonden niet op één lijn**: *Plaat* en *Plaatformaat*
stonden een paar pixels hoger dan *Rasterlijnen om de* en *Hoofdlijnen om de* ernaast.

## 0.30.2
- **Veiliger met bestanden van internet.** Bij een controle van de code zijn vier manieren gevonden
waarop een kwaadaardig gemaakt bestand PrintView3D kon misbruiken; alle vier zijn gedicht:
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ keep the normal look.

### Toolbar buttons

**Settings → Toolbar** (also **☰ → Customize toolbar…**, or right-click the toolbar) chooses which
**Settings → Toolbar** (also **☰ → Customize toolbar…**, or right-click the gear or an empty spot on the toolbar) chooses which
buttons the toolbar shows, for a calmer toolbar if you don't use every feature:

- **Can be hidden:** Home, Open, Check, View, Measure, Screenshot, Theme and Settings.
Expand All @@ -604,6 +604,18 @@ buttons the toolbar shows, for a calmer toolbar if you don't use every feature:
view buttons and Fit the last.
- **Nothing gets lost.** A hidden button keeps its key (`C`, `V`, `M`, `Ctrl+W`, …), and the **☰**
menu has everything, including Check, View, Measure and the Theme menu.
- **Right-click a button for its settings.** Each button offers one item that opens Settings at
that button's own options:

| Right-click on | Opens |
|---|---|
| Theme | **Appearance** (the themes) |
| Screenshot | **Files → Screenshots** (the folder, save without asking) |
| Open in slicer | **Slicer** (the default slicer) |
| Export STL | **Files → Export STL** (what a click does) |
| Plate | **Viewer → Build plate** |
| Check, View, Measure | **Viewer → Measure, View and Check** |
| Settings, Home, Open, Fit or an empty spot | **Customize toolbar…** |

Under **Look** you choose how the view buttons (Plate, Check, View, Measure and Fit) are labelled:
**icon, name and key** (*Plate (P)*, the default), **icon and name** (*Plate*), **icon and key**
Expand Down
16 changes: 14 additions & 2 deletions docs/use.ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,27 @@ Windows أو في وضع توفير البطارية. يحتفظ Windows 10 وا

## أزرار شريط الأدوات {#toolbar-buttons}

تختار **الإعدادات ← شريط الأدوات** (أو **☰ ← تخصيص شريط الأدوات…**، أو النقر بالزر الأيمن على شريط
الأدوات) الأزرار التي يعرضها شريط الأدوات، لشريط أهدأ إن لم تكن تستخدم كل الميزات:
تختار **الإعدادات ← شريط الأدوات** (أو **☰ ← تخصيص شريط الأدوات…**، أو النقر بالزر الأيمن على زر
الإعدادات أو على مكان فارغ في شريط الأدوات) الأزرار التي يعرضها شريط الأدوات، لشريط أهدأ إن لم تكن تستخدم كل الميزات:

- **يمكن إخفاؤها:** الرئيسية، فتح، فحص، العرض، قياس، لقطة شاشة، السمة والإعدادات.
- **ظاهرة دائماً:** القائمة **☰**، الفتح في برنامج التقطيع، تصدير STL (لملفات 3MF وCAD)، اللوحة وملاءمة.
- **لا يتغيّر الترتيب أبداً.** الزر المخفي يغادر شريط الأدوات فقط؛ تبقى اللوحة أول أزرار العرض
وملاءمة آخرها.
- **لا يضيع شيء.** يحتفظ الزر المخفي باختصاره (`C` و`V` و`M` و`Ctrl+W`…)، وفي القائمة **☰** كل
شيء، ومنه فحص والعرض وقياس وقائمة السمة.
- **انقر بالزر الأيمن على زر لتصل إلى إعداداته.** يعرض كل زر عنصراً واحداً يفتح الإعدادات عند
خيارات ذلك الزر نفسه:

| النقر بالزر الأيمن على | يفتح |
|---|---|
| السمة | **المظهر** (السمات) |
| لقطة شاشة | **الملفات ← لقطات الشاشة** (المجلد، والحفظ دون سؤال) |
| فتح في برنامج التقطيع | **برنامج التقطيع** (البرنامج الافتراضي) |
| تصدير STL | **الملفات ← تصدير STL** (ما تفعله النقرة) |
| اللوحة | **العارض ← لوحة الطباعة** |
| فحص، العرض، قياس | **العارض ← القياس والعرض والفحص** |
| الإعدادات، الرئيسية، فتح، ملاءمة أو مكان فارغ | **تخصيص شريط الأدوات…** |

تحت **الشكل** تختار كيف تُكتب أزرار العرض (اللوحة، فحص، العرض، قياس وملاءمة): **الأيقونة والاسم
والاختصار** (*اللوحة (P)*، الافتراضي)، **الأيقونة والاسم** (*اللوحة*)، **الأيقونة والاختصار** (*P*)
Expand Down
14 changes: 13 additions & 1 deletion docs/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ keep the normal look.

## Toolbar buttons

**Settings → Toolbar** (also **☰ → Customize toolbar…**, or right-click the toolbar) chooses which
**Settings → Toolbar** (also **☰ → Customize toolbar…**, or right-click the gear or an empty spot on the toolbar) chooses which
buttons the toolbar shows, for a calmer toolbar if you don't use every feature:

- **Can be hidden:** Home, Open, Check, View, Measure, Screenshot, Theme and Settings.
Expand All @@ -264,6 +264,18 @@ buttons the toolbar shows, for a calmer toolbar if you don't use every feature:
view buttons and Fit the last.
- **Nothing gets lost.** A hidden button keeps its key (`C`, `V`, `M`, `Ctrl+W`, …), and the **☰**
menu has everything, including Check, View, Measure and the Theme menu.
- **Right-click a button for its settings.** Each button offers one item that opens Settings at
that button's own options:

| Right-click on | Opens |
|---|---|
| Theme | **Appearance** (the themes) |
| Screenshot | **Files → Screenshots** (the folder, save without asking) |
| Open in slicer | **Slicer** (the default slicer) |
| Export STL | **Files → Export STL** (what a click does) |
| Plate | **Viewer → Build plate** |
| Check, View, Measure | **Viewer → Measure, View and Check** |
| Settings, Home, Open, Fit or an empty spot | **Customize toolbar…** |

Under **Look** you choose how the view buttons (Plate, Check, View, Measure and Fit) are labelled:
**icon, name and key** (*Plate (P)*, the default), **icon and name** (*Plate*), **icon and key**
Expand Down
15 changes: 14 additions & 1 deletion docs/use.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ uiterlijk.

## Knoppen op de werkbalk {#toolbar-buttons}

**Instellingen → Werkbalk** (ook **☰ → Werkbalk aanpassen…**, of klik met rechts op de werkbalk)
**Instellingen → Werkbalk** (ook **☰ → Werkbalk aanpassen…**, of klik met rechts op het tandwiel of een lege plek op de
werkbalk)
kiest welke knoppen de werkbalk toont, voor een rustigere werkbalk als je niet alles gebruikt:

- **Kunnen verborgen worden:** Start, Openen, Controleren, Weergave, Meten, Schermafbeelding, Thema
Expand All @@ -268,6 +269,18 @@ kiest welke knoppen de werkbalk toont, voor een rustigere werkbalk als je niet a
de eerste van de weergaveknoppen en Passend de laatste.
- **Er raakt niets kwijt.** Een verborgen knop houdt zijn toets (`C`, `V`, `M`, `Ctrl+W`, …), en het
**☰**-menu heeft alles, ook Controleren, Weergave, Meten en het themamenu.
- **Klik met rechts op een knop voor zijn instellingen.** Elke knop biedt één item dat Instellingen
opent bij de eigen opties van die knop:

| Rechtsklik op | Opent |
|---|---|
| Thema | **Uiterlijk** (de thema's) |
| Schermafbeelding | **Bestanden → Schermafbeeldingen** (de map, opslaan zonder te vragen) |
| Openen in slicer | **Slicer** (de standaardslicer) |
| STL exporteren | **Bestanden → STL exporteren** (wat een klik doet) |
| Plaat | **Weergave → Printplaat** |
| Controleren, Weergave, Meten | **Weergave → Meten, weergave en controleren** |
| Instellingen, Start, Openen, Passend of een lege plek | **Werkbalk aanpassen…** |

Onder **Uiterlijk** kies je hoe de weergaveknoppen (Plaat, Controleren, Weergave, Meten en Passend)
eruitzien: **pictogram, naam en toets** (*Plaat (P)*, de standaard), **pictogram en naam** (*Plaat*),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "printview3d"
version = "0.30.2"
version = "0.30.3"
description = "Lightweight viewer for STL, 3MF, G-code and FreeCAD files with one-click hand-off to your slicer; FreeCAD files go to the slicer as a model directly"
readme = "README.md"
license = { text = "MIT" }
Expand Down
2 changes: 1 addition & 1 deletion src/printview3d/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""PrintView3D - a lightweight viewer for STL, 3MF and G-code files."""

__version__ = "0.30.2"
__version__ = "0.30.3"
APP_NAME = "PrintView3D"
APP_ID = "PrintView3D"
42 changes: 35 additions & 7 deletions src/printview3d/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,9 @@ def _build_toolbar(self):
# Settings -> Toolbar: the toolbar's place of every button that can be hidden (its
# QAction in the toolbar, so hiding it leaves the menus and keys alone).
self.toolbar_slots: dict[str, QAction] = {}
# Right-click on the toolbar: Customize toolbar... (instead of Qt's hide-the-toolbar menu).
# Right-click on the toolbar (instead of Qt's hide-the-toolbar menu): one item. On a button
# with settings of its own, those settings; on the Settings gear, Home, Open, Fit and the
# empty part of the toolbar, Customize toolbar...
tb.setContextMenuPolicy(Qt.CustomContextMenu)
tb.customContextMenuRequested.connect(self._toolbar_context_menu)

Expand Down Expand Up @@ -1081,10 +1083,35 @@ def _menu_mirror(self, act: QAction) -> QAction:
m.setEnabled(act.isEnabled())
return m

def _toolbar_button_settings(self, w) -> Optional[tuple[str, str, str]]:
"""The Settings a toolbar button's right-click offers: (menu text, page, section). None for
the Settings gear (a click already opens Settings), buttons without settings of their own
(Home, Open, Fit) and the empty part of the toolbar: they offer Customize toolbar..."""
buttons = {
self.theme_btn: (tr("Theme settings…"), "appearance", ""),
self.screenshot_btn: (tr("Screenshot settings…"), "", "screenshots"),
self.slicer_btn: (tr("Slicer settings…"), "slicer", ""),
self.export_btn: (tr("Export STL settings…"), "", "export"),
self.plate_btn: (tr("Build plate settings…"), "", "plate"),
}
for b in (self.check_btn, self.view_btn, self.measure_btn):
buttons[b] = (tr("Measure, View and Check settings…"), "", "measure")
while w is not None and w is not self.toolbar: # the icon or label inside a button
if w in buttons:
return buttons[w]
w = w.parentWidget()
return None

def _toolbar_context_menu(self, pos):
menu = QMenu(self)
menu.addAction(self.act_customize_toolbar)
own = self._toolbar_button_settings(self.toolbar.childAt(pos))
if own is not None: # one item: the button's own settings
text, page, section = own
menu.addAction(text, lambda p=page, s=section: self.open_settings(p, s))
else:
menu.addAction(self.act_customize_toolbar)
menu.exec(self.toolbar.mapToGlobal(pos))
menu.deleteLater() # a new menu each right-click: don't keep them

def apply_toolbar_layout(self, hide: Optional[set] = None, labels: Optional[str] = None,
join: Optional[bool] = None):
Expand Down Expand Up @@ -4087,19 +4114,20 @@ def _auto_screenshot_path(self, base: str) -> str:
n += 1
return path

def open_settings(self, page: str = ""):
def open_settings(self, page: str = "", section: str = ""):
"""Settings, not modal: the main window keeps working while it is open. Opened again
(key, menu) while it is open, the same window comes to the front, on the page asked for."""
(key, menu) while it is open, the same window comes to the front, on the page asked for.
A section (a toolbar button's right-click) is a box on a page, scrolled into view."""
dlg = getattr(self, "settings_dialog", None)
if dlg is not None:
if page:
dlg.show_page(page)
if page or section:
dlg.show_page(page, section)
dlg.showNormal()
dlg.raise_()
dlg.activateWindow()
return
self._freecad_before = self.settings.get("freecad_path", "")
dlg = SettingsDialog(self.settings, self, renderer_info(self.plotter), page=page)
dlg = SettingsDialog(self.settings, self, renderer_info(self.plotter), page=page, section=section)
dlg.setModal(False)
dlg.setAttribute(Qt.WA_DeleteOnClose)
dlg.applied.connect(self._settings_applied) # Apply: shown now, the dialog stays
Expand Down
Loading
Loading