Skip to content

Commit

Permalink
V2022.8.3
Browse files Browse the repository at this point in the history
- Introduced ribbon interface for commands
  • Loading branch information
nlogozzo committed Aug 13, 2022
1 parent b56b914 commit 6035443
Show file tree
Hide file tree
Showing 8 changed files with 340 additions and 249 deletions.
2 changes: 1 addition & 1 deletion Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Nickvision Tagger"
#define MyAppVersion "2022.8.2"
#define MyAppVersion "2022.8.3"
#define MyAppPublisher "Nickvision"
#define MyAppURL "http://nickvision.org/"
#define MyAppExeName "NickvisionTagger.exe"
Expand Down
12 changes: 12 additions & 0 deletions NickvisionTagger/Helpers/ThemeHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ namespace NickvisionTagger::Helpers
}
}

QString ThemeHelpers::getThemedRibbonStyle()
{
if (Configuration::getInstance().getTheme() == Theme::Light)
{
return "QTabWidget::pane { background: transparent; border: 1px solid #c4c2c2; }";
}
else
{
return "QTabWidget::pane { background: transparent; border: 1px solid #2b2b2b; }";
}
}

void ThemeHelpers::applyWin32Theme(QWidget* widget)
{
BOOL isDarkMode{ Configuration::getInstance().getTheme() == Theme::Light ? FALSE : TRUE };
Expand Down
5 changes: 5 additions & 0 deletions NickvisionTagger/Helpers/ThemeHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ namespace NickvisionTagger::Helpers::ThemeHelpers
/// <returns>Separator stylesheet themed for Configuration::getTheme()</returns>
QString getThemedSeparatorStyle();
/// <summary>
/// Gets a themed stylesheet for a ribbon (QTabWidget)
/// </summary>
/// <returns>Ribbon stylesheet themed for Configuration::getTheme()</returns>
QString getThemedRibbonStyle();
/// <summary>
/// Applys Win32 theming to QWidget's Title Bar
/// </summary>
/// <param name="widget">The QWidget object</param>
Expand Down
4 changes: 2 additions & 2 deletions NickvisionTagger/Models/MediaFileType.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NickvisionTagger::Models
public:
enum Value
{
MP4,
MP4 = 0,
WEBM,
MP3,
OGG,
Expand All @@ -20,6 +20,7 @@ namespace NickvisionTagger::Models
WAV
};

MediaFileType() = delete;
MediaFileType(Value fileType);
static std::optional<MediaFileType> parse(const std::string& s);
operator Value() const;
Expand All @@ -34,7 +35,6 @@ namespace NickvisionTagger::Models
bool isVideo() const;

private:
MediaFileType();
Value m_value;
};
}
Expand Down
31 changes: 16 additions & 15 deletions NickvisionTagger/UI/Views/TaggerPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ namespace NickvisionTagger::UI::Views
{
//==UI==//
m_ui.setupUi(this);
//Ribbon
m_ui.ribbon->setCurrentIndex(0);
//Buttons
m_ui.btnRefreshMusicFolder->setVisible(false);
m_ui.btnCloseMusicFolder->setVisible(false);
Expand All @@ -29,11 +31,10 @@ namespace NickvisionTagger::UI::Views
m_ui.separator1->setVisible(false);
m_ui.btnInsertAlbumArt->setVisible(false);
m_ui.btnRemoveAlbumArt->setVisible(false);
m_ui.separator2->setVisible(false);
m_ui.btnFilenameToTag->setVisible(false);
m_ui.btnTagToFilename->setVisible(false);
//Tag Properties
m_ui.separator3->setVisible(false);
m_ui.separator2->setVisible(false);
m_ui.scrollTagProperties->setVisible(false);
m_ui.txtYear->installEventFilter(new IgnoreWheelEventFilter(m_ui.txtYear));
m_ui.txtTrack->installEventFilter(new IgnoreWheelEventFilter(m_ui.txtTrack));
Expand All @@ -55,9 +56,9 @@ namespace NickvisionTagger::UI::Views

void TaggerPage::refreshTheme()
{
m_ui.ribbon->setStyleSheet(ThemeHelpers::getThemedRibbonStyle());
m_ui.separator1->setStyleSheet(ThemeHelpers::getThemedSeparatorStyle());
m_ui.separator2->setStyleSheet(ThemeHelpers::getThemedSeparatorStyle());
m_ui.separator3->setStyleSheet(ThemeHelpers::getThemedSeparatorStyle());
}

void TaggerPage::updateConfig()
Expand Down Expand Up @@ -330,20 +331,30 @@ namespace NickvisionTagger::UI::Views
m_selectedMusicFiles.push_back(m_musicFolder.getFiles()[item->row()]);
}
//==Update UI==//
m_ui.ribbon->setCurrentIndex(1);
m_ui.btnSaveTags->setVisible(true);
m_ui.btnRemoveTags->setVisible(true);
m_ui.separator1->setVisible(true);
m_ui.btnInsertAlbumArt->setVisible(true);
m_ui.btnRemoveAlbumArt->setVisible(true);
m_ui.separator2->setVisible(true);
m_ui.btnFilenameToTag->setVisible(true);
m_ui.btnTagToFilename->setVisible(true);
m_ui.separator3->setVisible(true);
m_ui.separator2->setVisible(true);
m_ui.scrollTagProperties->setVisible(true);
m_ui.txtFilename->setReadOnly(false);
//==No Files Selected==//
if (m_selectedMusicFiles.size() == 0)
{
m_ui.ribbon->setCurrentIndex(0);
m_ui.btnSaveTags->setVisible(false);
m_ui.btnRemoveTags->setVisible(false);
m_ui.separator1->setVisible(false);
m_ui.btnInsertAlbumArt->setVisible(false);
m_ui.btnRemoveAlbumArt->setVisible(false);
m_ui.btnFilenameToTag->setVisible(false);
m_ui.btnTagToFilename->setVisible(false);
m_ui.separator2->setVisible(false);
m_ui.scrollTagProperties->setVisible(false);
m_ui.txtFilename->setText("");
m_ui.txtTitle->setText("");
m_ui.txtArtist->setText("");
Expand All @@ -356,16 +367,6 @@ namespace NickvisionTagger::UI::Views
m_ui.txtDuration->setText("");
m_ui.txtFileSize->setText("");
m_ui.imgAlbumArt->setPixmap({});
m_ui.btnSaveTags->setVisible(false);
m_ui.btnRemoveTags->setVisible(false);
m_ui.separator1->setVisible(false);
m_ui.btnInsertAlbumArt->setVisible(false);
m_ui.btnRemoveAlbumArt->setVisible(false);
m_ui.separator2->setVisible(false);
m_ui.btnFilenameToTag->setVisible(false);
m_ui.btnTagToFilename->setVisible(false);
m_ui.separator3->setVisible(false);
m_ui.scrollTagProperties->setVisible(false);
}
//==One File Selected==//
else if (m_selectedMusicFiles.size() == 1)
Expand Down
Loading

0 comments on commit 6035443

Please sign in to comment.