Skip to content

Commit

Permalink
[dbmanager] vectorize icons to fix toolbar in hidpi context
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 2, 2018
1 parent 9b0241c commit 53d4ad3
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 38 deletions.
3 changes: 3 additions & 0 deletions images/images.qrc
Expand Up @@ -234,20 +234,23 @@
<file>themes/default/mActionConditionalFormatting.svg</file>
<file>themes/default/mActionContextHelp.png</file>
<file>themes/default/mActionCreateMemory.svg</file>
<file>themes/default/mActionCreateTable.svg</file>
<file>themes/default/mActionCustomProjection.svg</file>
<file>themes/default/mActionDecreaseBrightness.svg</file>
<file>themes/default/mActionDecreaseContrast.svg</file>
<file>themes/default/mActionDeleteAttribute.svg</file>
<file>themes/default/mActionDeletePart.svg</file>
<file>themes/default/mActionDeleteRing.svg</file>
<file>themes/default/mActionDeleteSelected.svg</file>
<file>themes/default/mActionDeleteTable.svg</file>
<file>themes/default/mActionDeselectAll.svg</file>
<file>themes/default/mActionDraw.svg</file>
<file>themes/default/mActionDuplicateLayer.svg</file>
<file>themes/default/mActionDuplicateComposer.svg</file>
<file>themes/default/mActionEditCopy.svg</file>
<file>themes/default/mActionEditCut.svg</file>
<file>themes/default/mActionEditPaste.svg</file>
<file>themes/default/mActionEditTable.svg</file>
<file>themes/default/mActionExpandNewTree.svg</file>
<file>themes/default/mActionExpandTree.svg</file>
<file>themes/default/mActionFileExit.svg</file>
Expand Down
23 changes: 1 addition & 22 deletions images/themes/default/mActionAddTable.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/themes/default/mActionCreateTable.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/themes/default/mActionDeleteTable.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/themes/default/mActionEditTable.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions python/plugins/db_manager/db_manager.py
Expand Up @@ -29,7 +29,7 @@
from qgis.PyQt.QtGui import QIcon, QKeySequence

from qgis.gui import QgsMessageBar
from qgis.core import Qgis, QgsSettings, QgsMapLayer
from qgis.core import Qgis, QgsApplication, QgsSettings, QgsMapLayer
from qgis.utils import OverrideCursor

from .info_viewer import InfoViewer
Expand Down Expand Up @@ -429,7 +429,7 @@ def setupUi(self):
sep.setObjectName("DB_Manager_DbMenu_placeholder")
sep.setVisible(False)

self.actionRefresh = self.menuDb.addAction(QIcon(":/db_manager/actions/refresh"), self.tr("&Refresh"),
self.actionRefresh = self.menuDb.addAction(QgsApplication.getThemeIcon("/mActionDraw.svg"), self.tr("&Refresh"),
self.refreshActionSlot, QKeySequence("F5"))
self.actionSqlWindow = self.menuDb.addAction(QIcon(":/db_manager/actions/sql_window"), self.tr("&SQL Window"),
self.runSqlWindow, QKeySequence("F2"))
Expand Down Expand Up @@ -463,5 +463,11 @@ def setupUi(self):
# add actions to the toolbar
self.toolBar.addAction(self.actionRefresh)
self.toolBar.addAction(self.actionSqlWindow)
self.toolBar.addSeparator()
self.toolBar.addAction(self.actionImport)
self.toolBar.addAction(self.actionExport)

widget = self.toolBar.widgetForAction(self.actionImport)
widget.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
widget = self.toolBar.widgetForAction(self.actionExport)
widget.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/oracle/plugin.py
Expand Up @@ -241,17 +241,17 @@ def registerDatabaseActions(self, mainWindow):
mainWindow.registerAction(action, None, self.deleteActionSlot)
action.setShortcuts(QKeySequence.Delete)

action = QAction(QIcon(":/db_manager/actions/create_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionCreateTable.svg"),
QApplication.translate(
"DBManagerPlugin", "&Create Table…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.createTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/edit_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionEditTable.svg"),
QApplication.translate(
"DBManagerPlugin", "&Edit Table…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.editTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/del_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionDeleteTable.svg"),
QApplication.translate(
"DBManagerPlugin", "&Delete Table/View…"), self)
mainWindow.registerAction(action, QApplication.translate(
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/plugin.py
Expand Up @@ -327,14 +327,14 @@ def registerDatabaseActions(self, mainWindow):
mainWindow.registerAction(action, None, self.deleteActionSlot)
action.setShortcuts(QKeySequence.Delete)

action = QAction(QIcon(":/db_manager/actions/create_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionCreateTable.svg"),
QApplication.translate("DBManagerPlugin", "&Create Table…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
self.createTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/edit_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionEditTable.svg"),
QApplication.translate("DBManagerPlugin", "&Edit Table…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"), self.editTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/del_table"),
action = QAction(QgsApplication.getThemeIcon("/mActionDeleteTable.svg"),
QApplication.translate("DBManagerPlugin", "&Delete Table/View…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
self.deleteTableActionSlot)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53d4ad3

Please sign in to comment.