mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 00:34:16 +02:00
Fix images issues on HDPI resolution
This commit is contained in:
@@ -3,6 +3,7 @@ import sys
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ def main():
|
|||||||
app.setApplicationVersion(__version__)
|
app.setApplicationVersion(__version__)
|
||||||
app_icon = util.get_default_icon()[1]
|
app_icon = util.get_default_icon()[1]
|
||||||
app.setWindowIcon(app_icon)
|
app.setWindowIcon(app_icon)
|
||||||
|
app.setAttribute(Qt.AA_UseHighDpiPixmaps) # This fix images on HDPI resolution, not tested on non HDPI
|
||||||
|
|
||||||
if local_config['ui']['style']:
|
if local_config['ui']['style']:
|
||||||
app.setStyle(str(local_config['ui']['style']))
|
app.setStyle(str(local_config['ui']['style']))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import os
|
|||||||
from threading import Lock
|
from threading import Lock
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, QUrl
|
from PyQt5.QtCore import Qt, QUrl, QSize
|
||||||
from PyQt5.QtGui import QPixmap, QIcon, QCursor
|
from PyQt5.QtGui import QPixmap, QIcon, QCursor
|
||||||
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
|
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
|
||||||
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \
|
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \
|
||||||
@@ -77,7 +77,7 @@ class AppsTable(QTableWidget):
|
|||||||
self.setHorizontalHeaderLabels(['' for _ in range(self.columnCount())])
|
self.setHorizontalHeaderLabels(['' for _ in range(self.columnCount())])
|
||||||
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
self.icon_logo = QIcon(resource.get_path('img/logo.svg'))
|
self.icon_logo = QIcon(resource.get_path('img/logo.svg'))
|
||||||
self.pixmap_verified = QPixmap(resource.get_path('img/verified.svg'))
|
self.pixmap_verified = QIcon(resource.get_path('img/verified.svg')).pixmap(QSize(10, 10))
|
||||||
|
|
||||||
self.network_man = QNetworkAccessManager()
|
self.network_man = QNetworkAccessManager()
|
||||||
self.network_man.finished.connect(self._load_icon_and_cache)
|
self.network_man.finished.connect(self._load_icon_and_cache)
|
||||||
@@ -426,7 +426,7 @@ class AppsTable(QTableWidget):
|
|||||||
def run():
|
def run():
|
||||||
self.window.run_app(pkg)
|
self.window.run_app(pkg)
|
||||||
|
|
||||||
item.addWidget(IconButton(icon_path=resource.get_path('img/app_play.png'), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip']))
|
item.addWidget(IconButton(icon_path=resource.get_path('img/app_play.svg'), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip']))
|
||||||
|
|
||||||
if pkg.model.has_info():
|
if pkg.model.has_info():
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ class ManageWindow(QWidget):
|
|||||||
self.toolbar_search.addWidget(self.input_search)
|
self.toolbar_search.addWidget(self.input_search)
|
||||||
|
|
||||||
label_pos_search = QLabel()
|
label_pos_search = QLabel()
|
||||||
label_pos_search.setPixmap(QPixmap(resource.get_path('img/search.svg')))
|
# label_pos_search.setPixmap(QPixmap(resource.get_path('img/search.svg')))
|
||||||
|
label_pos_search.setPixmap(QIcon(resource.get_path('img/search.svg')).pixmap(QSize(10,10)))
|
||||||
label_pos_search.setStyleSheet("""
|
label_pos_search.setStyleSheet("""
|
||||||
background: white; padding-right: 10px;
|
background: white; padding-right: 10px;
|
||||||
border-top-right-radius: 5px;
|
border-top-right-radius: 5px;
|
||||||
@@ -157,7 +158,7 @@ class ManageWindow(QWidget):
|
|||||||
self.combo_filter_type.lineEdit().setReadOnly(True)
|
self.combo_filter_type.lineEdit().setReadOnly(True)
|
||||||
self.combo_filter_type.lineEdit().setAlignment(Qt.AlignCenter)
|
self.combo_filter_type.lineEdit().setAlignment(Qt.AlignCenter)
|
||||||
self.combo_filter_type.activated.connect(self._handle_type_filter)
|
self.combo_filter_type.activated.connect(self._handle_type_filter)
|
||||||
self.combo_filter_type.addItem(load_icon(resource.get_path('img/logo.svg'), 14), self.i18n['type'].capitalize(), self.any_type_filter)
|
self.combo_filter_type.addItem(load_icon(resource.get_path('img/logo.svg'), 48), self.i18n['type'].capitalize(), self.any_type_filter)
|
||||||
self.ref_combo_filter_type = self.toolbar.addWidget(self.combo_filter_type)
|
self.ref_combo_filter_type = self.toolbar.addWidget(self.combo_filter_type)
|
||||||
|
|
||||||
self.any_category_filter = 'any'
|
self.any_category_filter = 'any'
|
||||||
@@ -777,7 +778,7 @@ class ManageWindow(QWidget):
|
|||||||
icon = self.cache_type_filter_icons.get(app_type)
|
icon = self.cache_type_filter_icons.get(app_type)
|
||||||
|
|
||||||
if not icon:
|
if not icon:
|
||||||
icon = load_icon(icon_path, 14)
|
icon = load_icon(icon_path, 18)
|
||||||
self.cache_type_filter_icons[app_type] = icon
|
self.cache_type_filter_icons[app_type] = icon
|
||||||
|
|
||||||
self.combo_filter_type.addItem(icon, app_type.capitalize(), app_type)
|
self.combo_filter_type.addItem(icon, app_type.capitalize(), app_type)
|
||||||
|
|||||||
156
bauh/view/resources/img/app_play.svg
Normal file
156
bauh/view/resources/img/app_play.svg
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="app_play_s.svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
|
||||||
|
id="metadata856"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs854" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2051"
|
||||||
|
id="namedview852"
|
||||||
|
showgrid="false"
|
||||||
|
showborder="false"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:zoom="34.0625"
|
||||||
|
inkscape:cx="-8.9291475"
|
||||||
|
inkscape:cy="7.3386416"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Layer_1"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"><sodipodi:guide
|
||||||
|
position="-31.324771,24.014679"
|
||||||
|
orientation="0,1"
|
||||||
|
id="guide829"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="-31.706423,0"
|
||||||
|
orientation="0,1"
|
||||||
|
id="guide831"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="0,27.126606"
|
||||||
|
orientation="1,0"
|
||||||
|
id="guide833"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="16,22.957798"
|
||||||
|
orientation="1,0"
|
||||||
|
id="guide835"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="1.5559633,26.979817"
|
||||||
|
orientation="1,0"
|
||||||
|
id="guide947"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="-6.4587157,1.9963303"
|
||||||
|
orientation="0,1"
|
||||||
|
id="guide949"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="-12.770642,21.959633"
|
||||||
|
orientation="0,1"
|
||||||
|
id="guide951"
|
||||||
|
inkscape:locked="false" /><sodipodi:guide
|
||||||
|
position="24.044037,29.240367"
|
||||||
|
orientation="1,0"
|
||||||
|
id="guide836"
|
||||||
|
inkscape:locked="false" /></sodipodi:namedview>
|
||||||
|
<g
|
||||||
|
id="g819"
|
||||||
|
transform="matrix(0.03104434,0,0,0.03104584,0.64059904,4.1014743)"
|
||||||
|
style="fill:#ffffff;stroke:#333333">
|
||||||
|
|
||||||
|
<path
|
||||||
|
style="fill:#ffffff;stroke:#333333"
|
||||||
|
d="M 557.49784,206.99848 C 556.02332,209.32745 299.06055,50.553292 184.31451,-1.6920377 154.70662,-15.172888 152.32141,8.7631987 152.154,44.419264 c -0.8137,173.309056 -0.17793,416.751146 0,425.492356 0.73587,36.15214 -4.3986,60.9816 32.16051,42.58838 96.93285,-48.76779 383.3103,-210.32654 375.2762,-204.82682 68.97152,-41.77019 82.39599,-46.93515 -2.09287,-100.6747 z"
|
||||||
|
id="path817"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="csssscc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g821"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g823"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g825"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g827"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g829"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g831"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g833"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g835"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g837"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g839"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g841"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g843"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g845"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g847"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g849"
|
||||||
|
transform="translate(-152.62981,-488.02344)">
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.3 KiB |
Reference in New Issue
Block a user