various UI reimplementations from 0.1.x

This commit is contained in:
itsmattkc
2019-09-26 03:49:49 +10:00
parent c19718a4a5
commit 56e3fd41e5
70 changed files with 2056 additions and 1483 deletions
+5 -1
View File
@@ -24,7 +24,6 @@
Folder::Folder()
{
set_icon(olive::icon::Folder);
}
Item::Type Folder::type() const
@@ -36,3 +35,8 @@ bool Folder::CanHaveChildren() const
{
return true;
}
QIcon Folder::icon()
{
return olive::icon::Folder;
}
+2
View File
@@ -38,6 +38,8 @@ public:
virtual bool CanHaveChildren() const override;
virtual QIcon icon() override;
private:
};
+32 -37
View File
@@ -43,8 +43,6 @@ void Footage::set_status(const Footage::Status &status)
{
status_ = status;
UpdateIcon();
UpdateTooltip();
}
@@ -116,6 +114,38 @@ void Footage::set_decoder(const QString &id)
decoder_ = id;
}
QIcon Footage::icon()
{
switch (status_) {
case kUnprobed:
case kUnindexed:
// FIXME Set a waiting icon
return QIcon();
case kReady:
if (HasStreamsOfType(Stream::kVideo)) {
// Prioritize the video icon
return olive::icon::Video;
} else if (HasStreamsOfType(Stream::kAudio)) {
// Otherwise assume it's audio only
return olive::icon::Audio;
} else if (HasStreamsOfType(Stream::kImage)) {
// Otherwise assume it's an image
return olive::icon::Image;
}
/* fall through */
case kInvalid:
return olive::icon::Error;
}
return QIcon();
}
void Footage::ClearStreams()
{
if (streams_.empty()) {
@@ -138,41 +168,6 @@ bool Footage::HasStreamsOfType(const Stream::Type type)
return false;
}
void Footage::UpdateIcon()
{
switch (status_) {
case kUnprobed:
case kUnindexed:
// FIXME Set a waiting icon
set_icon(QIcon());
break;
case kReady:
if (HasStreamsOfType(Stream::kVideo)) {
// Prioritize the video icon
set_icon(olive::icon::Video);
break;
} else if (HasStreamsOfType(Stream::kAudio)) {
// Otherwise assume it's audio only
set_icon(olive::icon::Audio);
break;
} else if (HasStreamsOfType(Stream::kImage)) {
// Otherwise assume it's an image
set_icon(olive::icon::Image);
break;
}
/* fall through */
case kInvalid:
set_icon(olive::icon::Error);
break;
}
}
void Footage::UpdateTooltip()
{
switch (status_) {
+2
View File
@@ -205,6 +205,8 @@ public:
*/
void set_decoder(const QString& id);
virtual QIcon icon() override;
private:
/**
* @brief Internal function to delete all Stream children and empty the array
-10
View File
@@ -101,16 +101,6 @@ void Item::set_tooltip(const QString &t)
tooltip_ = t;
}
const QIcon &Item::icon()
{
return icon_;
}
void Item::set_icon(const QIcon &icon)
{
icon_ = icon;
}
Item *Item::parent() const
{
return parent_;
+1 -4
View File
@@ -92,8 +92,7 @@ public:
const QString& tooltip() const;
void set_tooltip(const QString& t);
const QIcon& icon();
void set_icon(const QIcon& icon);
virtual QIcon icon() = 0;
Item *parent() const;
const Item* root() const;
@@ -111,8 +110,6 @@ private:
QString name_;
QIcon icon_;
QString tooltip_;
};
+5 -1
View File
@@ -25,7 +25,6 @@
Sequence::Sequence()
{
set_icon(olive::icon::Sequence);
}
Item::Type Sequence::type() const
@@ -33,6 +32,11 @@ Item::Type Sequence::type() const
return kSequence;
}
QIcon Sequence::icon()
{
return olive::icon::Sequence;
}
const int &Sequence::video_width()
{
return video_width_;
+2
View File
@@ -38,6 +38,8 @@ public:
*/
virtual Type type() const override;
virtual QIcon icon() override;
/* VIDEO GETTER/SETTER FUNCTIONS */
const int& video_width();