From bcac882d2136c5612a89f2321584830a4dedc6fe Mon Sep 17 00:00:00 2001 From: Masayuki Satoh Date: Tue, 16 Sep 2014 17:12:06 +0900 Subject: [PATCH] =?utf8?q?=E3=83=84=E3=83=BC=E3=83=AB=E3=83=90=E3=83=BC?= =?utf8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E5=88=87=E6=9B=BF=E3=82=92=E5=AE=9F?= =?utf8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Gefu.pro | 2 +- README.md | 6 +++++- ReadMe.txt | 2 +- foldermodel.cpp | 5 ++++- folderpanel.cpp | 15 ++++++--------- installer-full.nsi | 4 ++-- installer.nsi | 4 ++-- keybind.txt | 1 + mainwindow.cpp | 27 +++++++++++++++++++++++++-- mainwindow.h | 1 + mainwindow.ui | 19 +++++++++++++++---- thumbnailworker.cpp | 16 ++++++++-------- 12 files changed, 71 insertions(+), 31 deletions(-) diff --git a/Gefu.pro b/Gefu.pro index 28875b4..4ff37db 100644 --- a/Gefu.pro +++ b/Gefu.pro @@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = Gefu TEMPLATE = app -VERSION = 0.2.3 +VERSION = 0.2.4 SOURCES += main.cpp\ mainwindow.cpp \ diff --git a/README.md b/README.md index 63e2439..dfc3290 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,14 @@ Gefu Gefu is an Experimental File Utility. #### Ver 0.24 - * ドラッグ検出のピクセル閾値を変更しました。 + * ドラッグ検出のピクセル閾値を小さくしました。 * フォルダビューのコンテキストメニューを変更しました。 + * フィルタラベルもフォルダビューと同じ文字色・背景色に変更しました。 + * サムネイル生成スレッドの優先度を調整しました。  * 不具合修正 * 単画面モードで検索ボックスが表示されなかったのを修正。 + * メニューの活性・非活性の整合性を修正。 + * サムネイルモードで拡大が行われていたのを修正。 #### 2014/09/15 Ver0.23 * 履歴選択ダイアログで、ダブルクリックで決定するようにしました。 diff --git a/ReadMe.txt b/ReadMe.txt index e2aa50b..03f98da 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -1,6 +1,6 @@ =============================================================================== Gefu(げふぅ) - Gefu is an Experimental File Utility - - Version 0.23 + Version 0.24 =============================================================================== 2014/09/15 @miyabi_satoh diff --git a/foldermodel.cpp b/foldermodel.cpp index 6723b4b..bde879b 100644 --- a/foldermodel.cpp +++ b/foldermodel.cpp @@ -160,7 +160,10 @@ QPixmap FolderModel::pixmap(const QModelIndex &index, const QSize &size) const if (!pixmap.isNull()) { double scaleX = 1.0 * size.width() / pixmap.width(); double scaleY = 1.0 * size.height() / pixmap.height(); - double scaleFactor = (scaleX > scaleY) ? scaleY : scaleX; + double scaleFactor = qMin(scaleX, scaleY); + if (scaleFactor > 1) { + return pixmap; + } return pixmap.scaled(pixmap.size() * scaleFactor, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); diff --git a/folderpanel.cpp b/folderpanel.cpp index 3690a3d..775079d 100644 --- a/folderpanel.cpp +++ b/folderpanel.cpp @@ -66,15 +66,6 @@ QAbstractItemView *FolderPanel::itemView() const } /////////////////////////////////////////////////////////////////////////////// -/// \brief FolderPanel::folderView -/// \return フォルダビューを返します。 -/// -//FolderView *FolderPanel::folderView() const -//{ -// return ui->folderView; -//} - -/////////////////////////////////////////////////////////////////////////////// /// \brief FolderPanel::model /// \return 関連付けられたフォルダモデルを返します。 /// @@ -176,6 +167,12 @@ void FolderPanel::updateAppearance(const Preferences &prefs) QPalette pal; + pal = ui->filterLabel->palette(); + pal.setColor(ui->filterLabel->backgroundRole(), prefs.folderViewBgColor(model()->isActive())); + pal.setColor(ui->filterLabel->foregroundRole(), prefs.folderViewFgColor(model()->isActive())); + ui->filterLabel->setAutoFillBackground(true); + ui->filterLabel->setPalette(pal); + pal = ui->locationBox->palette(); pal.setColor(QPalette::Base, prefs.locationBoxBgColor(model()->isActive())); pal.setColor(QPalette::Text, prefs.locationBoxFgColor(model()->isActive())); diff --git a/installer-full.nsi b/installer-full.nsi index d6507da..cae80c6 100644 --- a/installer-full.nsi +++ b/installer-full.nsi @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "Gefu" -!define PRODUCT_VERSION "0.23" +!define PRODUCT_VERSION "0.24" !define PRODUCT_PUBLISHER "@miyabi_satoh" !define PRODUCT_WEB_SITE "http://gefu.sourceforge.jp/" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Gefu.exe" @@ -51,7 +51,7 @@ var ICONS_GROUP ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "Gefu023_full_setup.exe" +OutFile "Gefu024_full_setup.exe" InstallDir "$PROGRAMFILES\Gefu" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show diff --git a/installer.nsi b/installer.nsi index 6fb391a..5edf833 100644 --- a/installer.nsi +++ b/installer.nsi @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "Gefu" -!define PRODUCT_VERSION "0.23" +!define PRODUCT_VERSION "0.24" !define PRODUCT_PUBLISHER "@miyabi_satoh" !define PRODUCT_WEB_SITE "http://gefu.sourceforge.jp/" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Gefu.exe" @@ -51,7 +51,7 @@ var ICONS_GROUP ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "Gefu023_Setup.exe" +OutFile "Gefu024_Setup.exe" InstallDir "$PROGRAMFILES\Gefu" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show diff --git a/keybind.txt b/keybind.txt index 8c813af..b442f3e 100644 --- a/keybind.txt +++ b/keybind.txt @@ -1,6 +1,7 @@ == キーバインド一覧 = 共通 ||キー ||装飾なし ||Shift ||Alt ||Ctrl(Command) ||覚え方 || +||T ||ツールバーを表示/非表示 || || || ||Toolbar || ||Q ||終了 || || || ||Quit || ||Z ||環境設定 ||アップデートを確認 || || || || ||+ ||フォントサイズを大きく/拡大 || || || || || diff --git a/mainwindow.cpp b/mainwindow.cpp index 701aa9f..085a7a7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1692,6 +1692,17 @@ void MainWindow::onToggleThumbnailMode(bool checked) } /////////////////////////////////////////////////////////////////////////////// +/// \brief MainWindow::onToggleToolbar +/// \param checked メニューのチェック状態 +/// +/// ツールバーの表示/非表示を切り替えます。 +/// +void MainWindow::onToggleToolbar(bool checked) +{ + ui->mainToolBar->setVisible(checked); +} + +/////////////////////////////////////////////////////////////////////////////// /// \brief MainWindow::onCheckUpdate /// \param silent 最新版を使用している場合に何も表示しないならtrue /// @@ -1829,6 +1840,7 @@ void MainWindow::initActions() connect(ui->toggle_Search, SIGNAL(toggled(bool)), this, SLOT(onToggleSearch(bool))); connect(ui->toggle_System, SIGNAL(toggled(bool)), this, SLOT(onToggleSystem(bool))); connect(ui->toggle_ThumbnailMode, SIGNAL(toggled(bool)), this, SLOT(onToggleThumbnailMode(bool))); + connect(ui->toggle_Toolbar, SIGNAL(toggled(bool)), this, SLOT(onToggleToolbar(bool))); connect(ui->view_Back, SIGNAL(triggered()), this, SLOT(view_finished())); @@ -2099,7 +2111,7 @@ void MainWindow::updateActions() ui->action_Rename->setEnabled(false); } - // 非二画面の場合、隣のパネルが必要な操作は無効にする + // 単画面またはプレビューモードの場合 if (!ui->LPanel->folderPanel()->isVisible() || !ui->RPanel->folderPanel()->isVisible()) { @@ -2110,9 +2122,16 @@ void MainWindow::updateActions() ui->action_SyncPanelTo->setEnabled(false); } - // 単画面の場合、プレビューモードは無効にする + // 単画面の場合 if (m_viewMode == ModeFull) { ui->toggle_PreviewMode->setEnabled(false); + ui->action_SplitCenter->setEnabled(false); + ui->action_ExpandLeft->setEnabled(false); + ui->action_ExpandRight->setEnabled(false); + ui->action_KeyDownOther->setEnabled(false); + ui->action_KeyEndOther->setEnabled(false); + ui->action_KeyHomeOther->setEnabled(false); + ui->action_KeyUpOther->setEnabled(false); } } else if (w->objectName() == "searchBox"){ @@ -2150,6 +2169,10 @@ void MainWindow::updateActions() reconnectAction(ui->image_Rotate180, SIGNAL(triggered()), v, SLOT(rotate180())); } + ui->toggle_Toolbar->blockSignals(true); + ui->toggle_Toolbar->setChecked(ui->mainToolBar->isVisible()); + ui->toggle_Toolbar->blockSignals(false); + ui->action_About->setEnabled(true); ui->action_CheckUpdate->setEnabled(true); ui->action_KeyDown->setEnabled(isView); diff --git a/mainwindow.h b/mainwindow.h index 0c0612c..97c9320 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -81,6 +81,7 @@ private slots: void onToggleSearch(bool checked); void onToggleSystem(bool checked); void onToggleThumbnailMode(bool checked); + void onToggleToolbar(bool checked); void showBookmarkDialog(); void showFilterDialog(); void showHistoryDialog(); diff --git a/mainwindow.ui b/mainwindow.ui index ada895c..570162f 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -49,6 +49,9 @@ + + ツールバー + false @@ -129,10 +132,10 @@ 表示(&V) + - @@ -145,6 +148,8 @@ + + @@ -266,9 +271,7 @@ - - - + 隣のパネルと同じフォルダを表示 @@ -1145,6 +1148,14 @@ . + + + true + + + ツールバー + + diff --git a/thumbnailworker.cpp b/thumbnailworker.cpp index 06e9ed7..29015e4 100644 --- a/thumbnailworker.cpp +++ b/thumbnailworker.cpp @@ -50,22 +50,22 @@ void ThumbnailWorker::doWork() { while (loop()) { QString path = getPath(); - if (path.isEmpty()) { - QThread::sleep(1); - } - else { + if (!path.isEmpty()) { QPixmap pixmap(path); if (!pixmap.isNull()) { QSize size(256, 256); double scaleX = 1.0 * size.width() / pixmap.width(); double scaleY = 1.0 * size.height() / pixmap.height(); - double scaleFactor = (scaleX > scaleY) ? scaleY : scaleX; - pixmap = pixmap.scaled(pixmap.size() * scaleFactor, - Qt::IgnoreAspectRatio, - Qt::SmoothTransformation); + double scaleFactor = qMin(scaleX, scaleY); + if (scaleFactor < 1) { + pixmap = pixmap.scaled(pixmap.size() * scaleFactor, + Qt::IgnoreAspectRatio, + Qt::SmoothTransformation); + } emit resultReady(path, pixmap); } } + QThread::msleep(100); } emit finished(); -- 2.11.0