mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
Merge branch 'hdpi_fix' into svg
# Conflicts: # bauh/view/qt/apps_table.py # bauh/view/qt/window.py # bauh/view/resources/img/app_play.svg
This commit is contained in:
@@ -2,7 +2,7 @@ import os
|
||||
from threading import Lock
|
||||
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.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
|
||||
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \
|
||||
@@ -78,7 +78,7 @@ class AppsTable(QTableWidget):
|
||||
self.setHorizontalHeaderLabels(['' for _ in range(self.columnCount())])
|
||||
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
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.finished.connect(self._load_icon_and_cache)
|
||||
@@ -342,9 +342,8 @@ class AppsTable(QTableWidget):
|
||||
|
||||
item.setText(name)
|
||||
|
||||
icon_path = pkg.model.get_disk_icon_path()
|
||||
if self.disk_cache and pkg.model.supports_disk_cache() and icon_path and os.path.isfile(icon_path):
|
||||
with open(icon_path, 'rb') as f:
|
||||
if self.disk_cache and pkg.model.supports_disk_cache() and pkg.model.get_disk_icon_path() and os.path.exists(pkg.model.get_disk_icon_path()):
|
||||
with open(pkg.model.get_disk_icon_path(), 'rb') as f:
|
||||
icon_bytes = f.read()
|
||||
pixmap = QPixmap()
|
||||
pixmap.loadFromData(icon_bytes)
|
||||
@@ -428,26 +427,26 @@ class AppsTable(QTableWidget):
|
||||
def run():
|
||||
self.window.run_app(pkg)
|
||||
|
||||
item.addWidget(IconButton(load_resource_icon('img/app_play.svg', 12), 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():
|
||||
|
||||
def get_info():
|
||||
self.window.get_app_info(pkg)
|
||||
|
||||
item.addWidget(IconButton(QIcon(resource.get_path('img/app_info.svg')), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
|
||||
item.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
|
||||
|
||||
if pkg.model.has_screenshots():
|
||||
def get_screenshots():
|
||||
self.window.get_screenshots(pkg)
|
||||
|
||||
item.addWidget(IconButton(QIcon(resource.get_path('img/camera.svg')), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip']))
|
||||
item.addWidget(IconButton(icon_path=resource.get_path('img/camera.svg'), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip']))
|
||||
|
||||
def handle_click():
|
||||
self.show_pkg_settings(pkg)
|
||||
|
||||
if self.has_any_settings(pkg):
|
||||
bt = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
|
||||
bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
|
||||
item.addWidget(bt)
|
||||
|
||||
self.setCellWidget(pkg.table_index, col, item)
|
||||
|
||||
Reference in New Issue
Block a user