From 29e486d418cf5d1261e9d023bd5ac35870c8dc6e Mon Sep 17 00:00:00 2001 From: pewpews Date: Fri, 20 May 2016 22:34:44 +0200 Subject: [PATCH] When adding files in a monitored folder, galleries will now be added into inbox; #150 Visual tweaks; --- res/style.css | 6 ++++-- version/app.py | 9 ++------ version/gallery.py | 4 ++-- version/io_misc.py | 52 +++++++++++++++++++++++----------------------- version/misc.py | 2 -- 5 files changed, 34 insertions(+), 39 deletions(-) diff --git a/res/style.css b/res/style.css index 2cef9ed..88c3f00 100644 --- a/res/style.css +++ b/res/style.css @@ -128,8 +128,10 @@ QToolTip { color: white; } -NotificationOverlay > * { - color:white; +NotificationOverlay > QLabel { + color: white; + background-color: #3E4249; + border-style: none; } TagText { diff --git a/version/app.py b/version/app.py index fd05042..b65497d 100644 --- a/version/app.py +++ b/version/app.py @@ -108,11 +108,6 @@ def remove_gallery(g): else: log_e('Could not find gallery to remove from watcher') - def create_gallery(path): - g_dia = gallerydialog.GalleryDialog(self, path) - g_dia.SERIES.connect(self.default_manga_view.add_gallery) - g_dia.show() - def update_gallery(g): index = gallery.CommonView.find_index(self.get_current_view(), g.id) if index: @@ -124,8 +119,8 @@ def update_gallery(g): self.default_manga_view.replace_gallery(g, False) def created(path): - c_popup = io_misc.CreatedPopup(path, self) - c_popup.ADD_SIGNAL.connect(create_gallery) + self.gallery_populate([path]) + def modified(path, gallery): mod_popup = io_misc.ModifiedPopup(path, gallery, self) def deleted(path, gallery): diff --git a/version/gallery.py b/version/gallery.py index 86d0f62..9afbf7a 100644 --- a/version/gallery.py +++ b/version/gallery.py @@ -824,7 +824,7 @@ def img_too_big(start_x): clip=clipping) loaded_image = gallery.get_profile(app_constants.ProfileType.Default) - if loaded_image and self._paint_level > 0 and self.view.scroll_speed < 1000: + if loaded_image and self._paint_level > 0 and self.view.scroll_speed < 600: # if we can't find a cached image pix_cache = QPixmapCache.find(self.key(loaded_image.cacheKey())) if isinstance(pix_cache, QPixmap): @@ -1199,7 +1199,7 @@ def _calculate_scroll_speed(self): self._scroll_zero_once = False # update view if not scrolling - if new_value < 500 and self._old_scroll_value > 500: + if new_value < 400 and self._old_scroll_value > 400: self.update() diff --git a/version/io_misc.py b/version/io_misc.py index 66279cb..5ba83aa 100644 --- a/version/io_misc.py +++ b/version/io_misc.py @@ -402,32 +402,32 @@ def __init__(self, path, gallery_id, parent=None): self.main_widget.setLayout(main_layout) self.show() -class CreatedPopup(misc.BasePopup): - ADD_SIGNAL = pyqtSignal(str) - def __init__(self, path, parent=None): - super().__init__(parent) - def commit(): - self.ADD_SIGNAL.emit(path) - self.close() - main_layout = QVBoxLayout() - inner_layout = QHBoxLayout() - name = os.path.split(path)[1] - cover = QLabel() - img = QPixmap(utils.get_gallery_img(path)) - if img: - cover.setPixmap(img.scaled(350, 200, Qt.KeepAspectRatio, Qt.SmoothTransformation)) - info_lbl = QLabel('New gallery detected!\n\n{}\n\nDo you want to add it?'.format(name)) - info_lbl.setWordWrap(True) - info_lbl.setAlignment(Qt.AlignCenter) - inner_layout.addWidget(cover) - inner_layout.addWidget(info_lbl) - main_layout.addLayout(inner_layout) - main_layout.addLayout(self.generic_buttons) - self.main_widget.setLayout(main_layout) - self.yes_button.clicked.connect(commit) - self.no_button.clicked.connect(self.close) - self.adjustSize() - self.show() +#class CreatedPopup(misc.BasePopup): +# ADD_SIGNAL = pyqtSignal(str) +# def __init__(self, path, parent=None): +# super().__init__(parent) +# def commit(): +# self.ADD_SIGNAL.emit(path) +# self.close() +# main_layout = QVBoxLayout() +# inner_layout = QHBoxLayout() +# name = os.path.split(path)[1] +# cover = QLabel() +# img = QPixmap(utils.get_gallery_img(path)) +# if img: +# cover.setPixmap(img.scaled(350, 200, Qt.KeepAspectRatio, Qt.SmoothTransformation)) +# info_lbl = QLabel('New gallery detected!\n\n{}\n\nDo you want to add it?'.format(name)) +# info_lbl.setWordWrap(True) +# info_lbl.setAlignment(Qt.AlignCenter) +# inner_layout.addWidget(cover) +# inner_layout.addWidget(info_lbl) +# main_layout.addLayout(inner_layout) +# main_layout.addLayout(self.generic_buttons) +# self.main_widget.setLayout(main_layout) +# self.yes_button.clicked.connect(commit) +# self.no_button.clicked.connect(self.close) +# self.adjustSize() +# self.show() class MovedPopup(misc.BasePopup): UPDATE_SIGNAL = pyqtSignal(object) diff --git a/version/misc.py b/version/misc.py index 11c334d..d92cfef 100644 --- a/version/misc.py +++ b/version/misc.py @@ -1565,8 +1565,6 @@ def __init__(self, parent=None): self._lbl = QLabel() self._main_layout.addWidget(self._lbl) self._lbl.setAlignment(Qt.AlignCenter) - self.setAutoFillBackground(True) - self.setBackgroundRole(self.palette().Shadow) self.setContentsMargins(-10,-10,-10,-10) self._click = False self._override_hide = False