mirror of
https://gitee.com/py2cn/pyminer.git
synced 2024-12-01 19:27:42 +08:00
提交删除单个工具栏及其按钮的代码
This commit is contained in:
parent
12d53fc15a
commit
6978451269
14
app2.py
14
app2.py
@ -231,7 +231,8 @@ class PMToolBarHome(PMGToolBar):
|
||||
':/color/source/theme/color/icons/help.svg'))
|
||||
self.add_tool_button('button_community', self.tr('Community'), self.tr('Use a browser to access the community'),
|
||||
create_icon(':/color/source/theme/color/icons/community.svg'))
|
||||
self.add_tool_button('button_feedback',self.tr('Feedback'),self.tr('Give your feedback.\nAll feedback are greatly appreciated.'),
|
||||
self.add_tool_button('button_feedback', self.tr('Feedback'),
|
||||
self.tr('Give your feedback.\nAll feedback are greatly appreciated.'),
|
||||
create_icon(':/color/source/theme/color/icons/feedback.svg'))
|
||||
self.addSeparator()
|
||||
|
||||
@ -647,6 +648,16 @@ class MainWindow(BaseMainWindow):
|
||||
console.moveCursor(QTextCursor.End)
|
||||
console.append(html)
|
||||
|
||||
def delete_toolbar(self, toolbar_name: str):
|
||||
assert toolbar_name in self.top_toolbar_tab.button_names
|
||||
tb_button_index = self.top_toolbar_tab.button_names.index(toolbar_name)
|
||||
self.top_toolbar_tab.button_names.pop(tb_button_index)
|
||||
tb_buttons =self.top_toolbar_tab.buttonbar_widget.findChildren(QPushButton)
|
||||
tb_buttons[tb_button_index].deleteLater()
|
||||
# tb_button.deleteLater()
|
||||
toolbar = self.toolbars.pop(toolbar_name)
|
||||
toolbar.deleteLater()
|
||||
|
||||
|
||||
def try_hide_terminal():
|
||||
if not '-d' in sys.argv:
|
||||
@ -695,6 +706,7 @@ def main():
|
||||
logger.info('boot finished at time:' + time.strftime('%H:%M:%S', time.localtime()) + '+%f s' % (
|
||||
time.time() - int(time.time())))
|
||||
window.switch_toolbar('toolbar_home', False)
|
||||
window.delete_toolbar('toolbar_home')
|
||||
res = app.exec_()
|
||||
logging.debug("Shutting down, result %d", res)
|
||||
logging.shutdown()
|
||||
|
Loading…
Reference in New Issue
Block a user