Photo share ui fixes & removed some hardcoded stylsheets

* Removed some hardcoded stylesheets for Album & Photo items.
* Ui layout fixes
This commit is contained in:
defnax 2021-01-09 16:47:04 +01:00
parent cc15593202
commit 5c1c6caf68
12 changed files with 143 additions and 50 deletions

View File

@ -81,7 +81,7 @@ void AlbumItem::setSelected(bool on)
} }
else else
{ {
ui->albumFrame->setStyleSheet("QFrame#albumFrame{border: 2px solid #CCCCCC;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 #CCCCCC);\nborder-radius: 10px}"); ui->albumFrame->setStyleSheet("");
} }
update(); update();
} }

View File

@ -17,10 +17,7 @@
<item> <item>
<widget class="QFrame" name="albumFrame"> <widget class="QFrame" name="albumFrame">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QFrame#albumFrame{border: 2px solid #CCCCCC; <string notr="true"/>
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
@ -52,6 +49,9 @@ border-radius: 10px}</string>
<property name="text"> <property name="text">
<string>TextLabel</string> <string>TextLabel</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -73,6 +73,8 @@ void PhotoDialog::setUp()
// Fixed %, then manually scale to that, with scroll area. // Fixed %, then manually scale to that, with scroll area.
ui->lineEdit_Title->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName)); ui->lineEdit_Title->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName));
ui->albumGroup->setTitle( tr("Album") + " / " + QString::fromStdString(mPhotoDetails.mMeta.mMsgName));
ui->frame_comments->setVisible(false); ui->frame_comments->setVisible(false);
ui->frame_details->setVisible(false); ui->frame_details->setVisible(false);
} }

View File

@ -24,6 +24,18 @@
</property> </property>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QGroupBox" name="albumGroup"> <widget class="QGroupBox" name="albumGroup">
<property name="sizePolicy"> <property name="sizePolicy">
@ -52,7 +64,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>540</width> <width>558</width>
<height>318</height> <height>318</height>
</rect> </rect>
</property> </property>
@ -167,7 +179,7 @@
<item> <item>
<widget class="QPushButton" name="commentsButton"> <widget class="QPushButton" name="commentsButton">
<property name="text"> <property name="text">
<string>&lt;N&gt; Comments &gt;&gt;</string> <string>Comments</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../icons.qrc"> <iconset resource="../icons.qrc">

View File

@ -101,11 +101,11 @@ void PhotoItem::setSelected(bool selected)
if (mSelected) if (mSelected)
{ {
ui->photoFrame->setStyleSheet("QFrame#photoFrame{border: 2px solid #9562B8;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #55EE55, stop: 1 " + bottomColor + ");\nborder-radius: 10px}"); ui->photoFrame->setStyleSheet("QFrame#photoFrame{border: 2px solid #9562B8;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #308dc7, stop: 1 " + bottomColor + ");\nborder-radius: 10px}");
} }
else else
{ {
ui->photoFrame->setStyleSheet("QFrame#photoFrame{border: 2px solid #CCCCCC;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 " + bottomColor + ");\nborder-radius: 10px}"); ui->photoFrame->setStyleSheet("");
} }
update(); update();
} }
@ -152,8 +152,8 @@ void PhotoItem::setUp()
mTitleLabel->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName)); mTitleLabel->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName));
ui->editLayOut->addWidget(mPhotoGrapherLabel);
ui->editLayOut->addWidget(mTitleLabel); ui->editLayOut->addWidget(mTitleLabel);
ui->editLayOut->addWidget(mPhotoGrapherLabel);
updateImage(mPhotoDetails.mLowResImage); updateImage(mPhotoDetails.mLowResImage);
} }
@ -203,3 +203,4 @@ void PhotoItem::mousePressEvent(QMouseEvent *event)
QWidget::mousePressEvent(event); QWidget::mousePressEvent(event);
} }

View File

@ -6,21 +6,18 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>253</width> <width>205</width>
<height>233</height> <height>228</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="0" column="0">
<widget class="QFrame" name="photoFrame"> <widget class="QFrame" name="photoFrame">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QFrame#photoFrame{border: 2px solid #CCCCCC; <string notr="true"/>
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
@ -30,11 +27,44 @@ border-radius: 10px}</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="label_Thumbnail"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="text"> <item>
<string>TextLabel</string> <spacer name="horizontalSpacer">
</property> <property name="orientation">
</widget> <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>17</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_Thumbnail">
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">

View File

@ -34,6 +34,7 @@
#include "AlbumGroupDialog.h" #include "AlbumGroupDialog.h"
#include "AlbumItem.h" #include "AlbumItem.h"
#include "PhotoItem.h" #include "PhotoItem.h"
#include "gui/common/FilesDefs.h"
/****** /******
* #define PHOTO_DEBUG 1 * #define PHOTO_DEBUG 1
@ -351,8 +352,9 @@ void PhotoShare::updateAlbums()
if (ui.pushButton_YourAlbums->isChecked()) if (ui.pushButton_YourAlbums->isChecked())
{ {
ui.toolButton_ViewEditAlbum->setText("Edit Album Details"); ui.toolButton_ViewEditAlbum->setText("Edit Album Details");
ui.toolButton_ViewEditAlbum->setIcon(FilesDefs::getPixmapFromQtResourcePath(":/images/kview_64.png"));
ui.toolButton_subscribe->setText("Delete Album"); ui.toolButton_subscribe->setText("Delete Album");
ui.toolButton_subscribe->setIcon(QIcon(":/images/album_unsubscribe.png")); ui.toolButton_subscribe->setIcon(FilesDefs::getPixmapFromQtResourcePath(":/images/album_unsubscribe.png"));
while (sit.hasNext()) { while (sit.hasNext()) {
@ -368,8 +370,9 @@ void PhotoShare::updateAlbums()
{ {
ui.toolButton_ViewEditAlbum->setText("View Album Details"); ui.toolButton_ViewEditAlbum->setText("View Album Details");
ui.toolButton_ViewEditAlbum->setIcon(FilesDefs::getPixmapFromQtResourcePath(":/images/kview_64.png"));
ui.toolButton_subscribe->setText("Unsubscribe From Album"); ui.toolButton_subscribe->setText("Unsubscribe From Album");
ui.toolButton_subscribe->setIcon(QIcon(":/images/album_unsubscribe.png")); ui.toolButton_subscribe->setIcon(FilesDefs::getPixmapFromQtResourcePath(":/images/album_unsubscribe.png"));
while (sit.hasNext()) { while (sit.hasNext()) {
@ -385,7 +388,7 @@ void PhotoShare::updateAlbums()
{ {
ui.toolButton_ViewEditAlbum->setText("View Album Details"); ui.toolButton_ViewEditAlbum->setText("View Album Details");
ui.toolButton_subscribe->setText("Subscribe To Album"); ui.toolButton_subscribe->setText("Subscribe To Album");
ui.toolButton_subscribe->setIcon(QIcon(":/images/album_subscribe.png")); ui.toolButton_subscribe->setIcon(FilesDefs::getPixmapFromQtResourcePath(":/images/album_subscribe.png"));
while (sit.hasNext()){ while (sit.hasNext()){

View File

@ -21,6 +21,7 @@
#include "gui/PhotoShare/PhotoSlideShow.h" #include "gui/PhotoShare/PhotoSlideShow.h"
#include "gui/PhotoShare/PhotoDrop.h" #include "gui/PhotoShare/PhotoDrop.h"
#include "gui/gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdDetails.h"
#include "gui/common/FilesDefs.h"
#define IMAGE_FULLSCREEN ":/icons/fullscreen.png" #define IMAGE_FULLSCREEN ":/icons/fullscreen.png"
#define IMAGE_FULLSCREENEXIT ":/icons/fullscreen-exit.png" #define IMAGE_FULLSCREENEXIT ":/icons/fullscreen-exit.png"
@ -33,23 +34,31 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, QWidget *parent)
{ {
ui.setupUi(this); ui.setupUi(this);
connect(ui.pushButton_ShiftLeft, SIGNAL( clicked( void ) ), this, SLOT( moveLeft( void ) ) ); connect(ui.toolButton_ShiftLeft, SIGNAL( clicked( void ) ), this, SLOT( moveLeft( void ) ) );
connect(ui.pushButton_ShiftRight, SIGNAL( clicked( void ) ), this, SLOT( moveRight( void ) ) ); connect(ui.toolButton_ShiftRight, SIGNAL( clicked( void ) ), this, SLOT( moveRight( void ) ) );
connect(ui.pushButton_ShowDetails, SIGNAL( clicked( void ) ), this, SLOT( showPhotoDetails( void ) ) ); connect(ui.pushButton_ShowDetails, SIGNAL( clicked( void ) ), this, SLOT( showPhotoDetails( void ) ) );
connect(ui.pushButton_StartStop, SIGNAL( clicked( void ) ), this, SLOT( StartStop( void ) ) ); connect(ui.pushButton_StartStop, SIGNAL( clicked( void ) ), this, SLOT( StartStop( void ) ) );
connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) ); connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) );
connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen())); connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen()));
mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this); ui.toolButton_ShiftLeft->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/arrow-left.png")));
ui.toolButton_ShiftRight->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/arrow-right.png")));
ui.albumLabel->setText(QString::fromStdString(mAlbum.mMeta.mGroupName));
mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this);
mRunning = true; mRunning = true;
mShotActive = true; mShotActive = true;
mImageIdx = 0; mImageIdx = 0;
requestPhotos(); requestPhotos();
loadImage(); loadImage();
//QTimer::singleShot(5000, this, SLOT(timerEvent())); //QTimer::singleShot(5000, this, SLOT(timerEvent()));
// not yet functional
ui.pushButton_ShowDetails->hide();
} }
PhotoSlideShow::~PhotoSlideShow() PhotoSlideShow::~PhotoSlideShow()
@ -199,20 +208,20 @@ void PhotoSlideShow::updateMoveButtons(uint32_t status)
switch(status) switch(status)
{ {
case PHOTO_SHIFT_NO_BUTTONS: case PHOTO_SHIFT_NO_BUTTONS:
ui.pushButton_ShiftLeft->setEnabled(false); ui.toolButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(false); ui.toolButton_ShiftRight->setEnabled(false);
break; break;
case PHOTO_SHIFT_LEFT_ONLY: case PHOTO_SHIFT_LEFT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(true); ui.toolButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(false); ui.toolButton_ShiftRight->setEnabled(false);
break; break;
case PHOTO_SHIFT_RIGHT_ONLY: case PHOTO_SHIFT_RIGHT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(false); ui.toolButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(true); ui.toolButton_ShiftRight->setEnabled(true);
break; break;
case PHOTO_SHIFT_BOTH: case PHOTO_SHIFT_BOTH:
ui.pushButton_ShiftLeft->setEnabled(true); ui.toolButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(true); ui.toolButton_ShiftRight->setEnabled(true);
break; break;
} }
} }

View File

@ -107,7 +107,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_ShiftLeft"> <widget class="QToolButton" name="toolButton_ShiftLeft">
<property name="text"> <property name="text">
<string>&lt;&lt;</string> <string>&lt;&lt;</string>
</property> </property>
@ -124,7 +124,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_ShiftRight"> <widget class="QToolButton" name="toolButton_ShiftRight">
<property name="text"> <property name="text">
<string>&gt;&gt;</string> <string>&gt;&gt;</string>
</property> </property>

View File

@ -1140,3 +1140,26 @@ WireGroupDialog QFrame#frame {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #9BDBF9, stop:1 #1592CD); background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #9BDBF9, stop:1 #1592CD);
border: 0px; border: 0px;
} }
PhotoShare QPushButton#pushButton_YourAlbums, QPushButton#pushButton_SubscribedAlbums,
QPushButton#pushButton_SharedAlbums {
font-size: 12pt;
}
AlbumItem QFrame#albumFrame {
border: 2px solid #CCCCCC;
border-radius: 10px
}
PhotoItem QFrame#photoFrame {
border: 2px solid #CCCCCC;
border-radius: 10px
}
PhotoItem QWidget:hover {
background-color: #7ecbfb;
}
PhotoSlideShow QLabel#albumLabel {
font-size: 12pt;
}

View File

@ -1284,7 +1284,7 @@ PulseViewGroup QToolButton#toolButton_follow {
color: white; color: white;
background: #0099cc; background: #0099cc;
border-radius: 4px; border-radius: 4px;
max-height: 27px; max-height: 20px;
min-width: 4em; min-width: 4em;
padding: 2px; padding: 2px;
padding-left: 6px; padding-left: 6px;
@ -1299,7 +1299,8 @@ PulseTopLevel QToolButton#toolButton_follow:hover, PulseViewGroup QToolButton#to
background: #03b1f3; background: #03b1f3;
border-radius: 4px; border-radius: 4px;
min-width: 4em; min-width: 4em;
padding: 2px; padding-left: 6px;
padding-right: 6px;
} }
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
@ -1310,9 +1311,11 @@ PulseAddDialog QPushButton#pushButton_Post:disabled {
color: white; color: white;
background: #d40000; background: #d40000;
border-radius: 4px; border-radius: 4px;
max-height: 27px; max-height: 20px;
min-width: 4em; min-width: 4em;
padding: 2px; padding: 2px;
padding-left: 6px;
padding-right: 6px;
} }
ShareManager QPushButton#closeButton { ShareManager QPushButton#closeButton {
@ -1479,6 +1482,10 @@ WireGroupItem QFrame#wire_frame
background: transparent; background: transparent;
} }
PulseReply #line_replyLine , PulseMessage #line{
color: #38444d;
}
RSTextBrowser, MimeTextEdit RSTextBrowser, MimeTextEdit
{ {
/*qproperty-textColorQuote: rgb(125, 125, 255);*/ /*qproperty-textColorQuote: rgb(125, 125, 255);*/
@ -1499,10 +1506,16 @@ MainWindow QListWidget {
font-size: 12pt; font-size: 12pt;
} }
ChatLobbyWidget QTreeWidget#lobbyTreeWidget{ PhotoShare QPushButton#pushButton_YourAlbums, QPushButton#pushButton_SubscribedAlbums,
font-size: 10pt; QPushButton#pushButton_SharedAlbums {
font-size: 12pt;
} }
NewFriendList QTreeView#peerTreeWidget { PhotoItem QFrame#photoFrame{
font-size: 12pt; border: 2px solid #3A3939;
}
AlbumItem QFrame#albumFrame {
border: 2px solid #3A3939;
border-radius: 10px
} }

View File

@ -40,7 +40,7 @@ protected:
void mousePressEvent(QMouseEvent* event) override; void mousePressEvent(QMouseEvent* event) override;
void enterEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #039bd5; }");} void enterEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #039bd5; }");}
void leaveEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #CCCCCC; border-radius: 3px; }");} void leaveEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("");}
bool mUseStyleSheet; bool mUseStyleSheet;
}; };