[flatpak] updating partials

This commit is contained in:
Vinícius Moreira
2020-01-10 16:11:45 -03:00
parent 969c647edf
commit 9d326efcd4
8 changed files with 56 additions and 51 deletions

View File

@@ -252,7 +252,7 @@ class AppsTable(QTableWidget):
col = QWidget()
col_bt = QPushButton()
col_bt.setText(text)
col_bt.setStyleSheet('QPushButton { ' + style + '}')
col_bt.setStyleSheet('QPushButton { ' + style + '} QPushButton:disabled { background: grey }')
col_bt.clicked.connect(callback)
layout = QHBoxLayout()
@@ -265,16 +265,11 @@ class AppsTable(QTableWidget):
def _set_col_installed(self, col: int, pkg: PackageView):
if pkg.model.installed:
if pkg.model.can_be_uninstalled():
def uninstall():
self._uninstall_app(pkg)
def uninstall():
self._uninstall_app(pkg)
item = self._gen_row_button(self.i18n['uninstall'].capitalize(), INSTALL_BT_STYLE.format(back='#cc0000'), uninstall)
else:
item = QLabel()
item.setPixmap((QPixmap(resource.get_path('img/checked.svg'))))
item.setAlignment(Qt.AlignCenter)
item.setToolTip(self.i18n['installed'])
item = self._gen_row_button(self.i18n['uninstall'].capitalize(), INSTALL_BT_STYLE.format(back='#cc0000'), uninstall)
item.setEnabled(pkg.model.can_be_uninstalled())
elif pkg.model.can_be_installed():
def install():
self._install_app(pkg)
@@ -423,31 +418,36 @@ class AppsTable(QTableWidget):
def _set_col_settings(self, col: int, pkg: PackageView):
item = QToolBar()
if pkg.model.can_be_run():
if pkg.model.installed:
def run():
self.window.run_app(pkg)
item.addWidget(IconButton(QIcon(resource.get_path('img/app_play.svg')), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip']))
bt = IconButton(QIcon(resource.get_path('img/app_play.svg')), action=run, background='#088A08', tooltip=self.i18n['action.run.tooltip'])
bt.setEnabled(pkg.model.can_be_run())
item.addWidget(bt)
if pkg.model.has_info():
def get_info():
self.window.get_app_info(pkg)
def get_info():
self.window.get_app_info(pkg)
bt = IconButton(QIcon(resource.get_path('img/app_info.svg')), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip'])
bt.setEnabled(bool(pkg.model.has_info()))
item.addWidget(bt)
item.addWidget(IconButton(QIcon(resource.get_path('img/app_info.svg')), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
if pkg.model.has_screenshots():
if not pkg.model.installed:
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']))
bt = IconButton(QIcon(resource.get_path('img/camera.svg')), action=get_screenshots, background='purple', tooltip=self.i18n['action.screenshots.tooltip'])
bt.setEnabled(bool(pkg.model.has_screenshots()))
item.addWidget(bt)
def handle_click():
self.show_pkg_settings(pkg)
if self.has_any_settings(pkg):
settings = self.has_any_settings(pkg)
if pkg.model.installed or settings:
bt = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
bt.setEnabled(bool(settings))
item.addWidget(bt)
self.setCellWidget(pkg.table_index, col, item)

View File

@@ -248,7 +248,9 @@ class IconButton(QWidget):
self.bt.clicked.connect(action)
if background:
self.bt.setStyleSheet('QToolButton { color: white; background: ' + background + '}')
style = 'QToolButton { color: white; background: ' + background + '} '
style += 'QToolButton:disabled { color: white; background: grey }'
self.bt.setStyleSheet(style)
if tooltip:
self.bt.setToolTip(tooltip)

View File

@@ -53,7 +53,7 @@ class ScreenshotsDialog(QDialog):
self.bottom_bar = QToolBar()
self.bt_back = QPushButton(self.i18n['screenshots.bt_back.label'].capitalize())
self.bt_back = QPushButton(' < ' + self.i18n['screenshots.bt_back.label'].capitalize())
self.bt_back.clicked.connect(self.back)
self.ref_bt_back = self.bottom_bar.addWidget(self.bt_back)
self.bottom_bar.addWidget(new_spacer(50))
@@ -65,7 +65,7 @@ class ScreenshotsDialog(QDialog):
self.ref_progress_bar = self.bottom_bar.addWidget(self.progress_bar)
self.bottom_bar.addWidget(new_spacer(50))
self.bt_next = QPushButton(self.i18n['screenshots.bt_next.label'].capitalize())
self.bt_next = QPushButton(self.i18n['screenshots.bt_next.label'].capitalize() + ' > ')
self.bt_next.clicked.connect(self.next)
self.ref_bt_next = self.bottom_bar.addWidget(self.bt_next)

View File

@@ -840,8 +840,7 @@ class ManageWindow(QWidget):
if (self.pkgs and accept_lower_width) or new_width > self.width():
self.resize(new_width, self.height())
if self.first_refresh:
qt_utils.centralize(self)
qt_utils.centralize(self)
def update_selected(self):
if self.pkgs: