- fixed the Distance adn Minimal Distance Tools not showing
This commit is contained in:
@@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta
|
||||
- in Geometry Properties UI restored the plot functionality
|
||||
- in Tool Cutout fixed issues when using a negative value for the Margin parameter when the cutout object is a Gerber object
|
||||
- fixed the Gerber parser such that when it encounter an aperture with size 0.0 it will replace it with the smallest number that is still displayed which is (10 ** -self.decimals); previously it replaced with a too small number (1e-12)
|
||||
- fixed the Distance adn Minimal Distance Tools not showing
|
||||
|
||||
17.11.2020
|
||||
|
||||
|
||||
@@ -97,8 +97,6 @@ class Distance(AppTool):
|
||||
if self.app.tool_tab_locked is True:
|
||||
return
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Distance Tool"))
|
||||
|
||||
# if the splitter is hidden, display it
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
@@ -114,6 +112,20 @@ class Distance(AppTool):
|
||||
AppTool.install(self, icon, separator, shortcut='Ctrl+M', **kwargs)
|
||||
|
||||
def set_tool_ui(self):
|
||||
# if the Tool Tab is hidden display it, else hide it but only if the objectName is the same
|
||||
found_idx = None
|
||||
for idx in range(self.app.ui.notebook.count()):
|
||||
if self.app.ui.notebook.widget(idx).objectName() == "tool_tab":
|
||||
found_idx = idx
|
||||
break
|
||||
# show the Tab
|
||||
if not found_idx:
|
||||
self.app.ui.notebook.addTab(self.app.ui.tool_tab, _("Tool"))
|
||||
# focus on Tool Tab
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab)
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Distance Tool"))
|
||||
|
||||
# Remove anything else in the appGUI
|
||||
self.app.ui.tool_scroll_area.takeWidget()
|
||||
|
||||
|
||||
@@ -53,8 +53,6 @@ class DistanceMin(AppTool):
|
||||
if self.app.tool_tab_locked is True:
|
||||
return
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Minimum Distance Tool"))
|
||||
|
||||
# if the splitter is hidden, display it
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
@@ -70,6 +68,20 @@ class DistanceMin(AppTool):
|
||||
AppTool.install(self, icon, separator, shortcut='Shift+M', **kwargs)
|
||||
|
||||
def set_tool_ui(self):
|
||||
# if the Tool Tab is hidden display it, else hide it but only if the objectName is the same
|
||||
found_idx = None
|
||||
for idx in range(self.app.ui.notebook.count()):
|
||||
if self.app.ui.notebook.widget(idx).objectName() == "tool_tab":
|
||||
found_idx = idx
|
||||
break
|
||||
# show the Tab
|
||||
if not found_idx:
|
||||
self.app.ui.notebook.addTab(self.app.ui.tool_tab, _("Tool"))
|
||||
# focus on Tool Tab
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab)
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Minimum Distance Tool"))
|
||||
|
||||
# Remove anything else in the appGUI
|
||||
self.app.ui.tool_scroll_area.takeWidget()
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ class App(QtCore.QObject):
|
||||
# ########################################## Tools and Plugins ##############################################
|
||||
# ###########################################################################################################
|
||||
|
||||
self.shell = None
|
||||
self.shell = FCShell(app=self, version=self.version)
|
||||
self.dblsidedtool = None
|
||||
self.distance_tool = None
|
||||
self.distance_min_tool = None
|
||||
@@ -1804,7 +1804,7 @@ class App(QtCore.QObject):
|
||||
:return: None
|
||||
"""
|
||||
|
||||
# shell tool has t obe initialized always first because other tools print messages in the Shell Dock
|
||||
# shell tool has to be initialized always first because other tools print messages in the Shell Dock
|
||||
self.shell = FCShell(app=self, version=self.version)
|
||||
|
||||
self.distance_tool = Distance(self)
|
||||
|
||||
Reference in New Issue
Block a user