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
{
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();
}

View File

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

View File

@ -73,6 +73,8 @@ void PhotoDialog::setUp()
// Fixed %, then manually scale to that, with scroll area.
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_details->setVisible(false);
}

View File

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

View File

@ -101,11 +101,11 @@ void PhotoItem::setSelected(bool selected)
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
{
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();
}
@ -152,8 +152,8 @@ void PhotoItem::setUp()
mTitleLabel->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName));
ui->editLayOut->addWidget(mPhotoGrapherLabel);
ui->editLayOut->addWidget(mTitleLabel);
ui->editLayOut->addWidget(mPhotoGrapherLabel);
updateImage(mPhotoDetails.mLowResImage);
}
@ -203,3 +203,4 @@ void PhotoItem::mousePressEvent(QMouseEvent *event)
QWidget::mousePressEvent(event);
}

View File

@ -6,21 +6,18 @@
<rect>
<x>0</x>
<y>0</y>
<width>253</width>
<height>233</height>
<width>205</width>
<height>228</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QFrame" name="photoFrame">
<property name="styleSheet">
<string notr="true">QFrame#photoFrame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
@ -29,13 +26,46 @@ border-radius: 10px}</string>
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>

View File

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

View File

@ -21,6 +21,7 @@
#include "gui/PhotoShare/PhotoSlideShow.h"
#include "gui/PhotoShare/PhotoDrop.h"
#include "gui/gxs/GxsIdDetails.h"
#include "gui/common/FilesDefs.h"
#define IMAGE_FULLSCREEN ":/icons/fullscreen.png"
#define IMAGE_FULLSCREENEXIT ":/icons/fullscreen-exit.png"
@ -33,13 +34,18 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, QWidget *parent)
{
ui.setupUi(this);
connect(ui.pushButton_ShiftLeft, SIGNAL( clicked( void ) ), this, SLOT( moveLeft( void ) ) );
connect(ui.pushButton_ShiftRight, SIGNAL( clicked( void ) ), this, SLOT( moveRight( void ) ) );
connect(ui.toolButton_ShiftLeft, SIGNAL( clicked( void ) ), this, SLOT( moveLeft( 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_StartStop, SIGNAL( clicked( void ) ), this, SLOT( StartStop( void ) ) );
connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) );
connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen()));
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;
@ -50,6 +56,9 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, QWidget *parent)
requestPhotos();
loadImage();
//QTimer::singleShot(5000, this, SLOT(timerEvent()));
// not yet functional
ui.pushButton_ShowDetails->hide();
}
PhotoSlideShow::~PhotoSlideShow()
@ -199,20 +208,20 @@ void PhotoSlideShow::updateMoveButtons(uint32_t status)
switch(status)
{
case PHOTO_SHIFT_NO_BUTTONS:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(false);
ui.toolButton_ShiftLeft->setEnabled(false);
ui.toolButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_LEFT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(false);
ui.toolButton_ShiftLeft->setEnabled(true);
ui.toolButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_RIGHT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(true);
ui.toolButton_ShiftLeft->setEnabled(false);
ui.toolButton_ShiftRight->setEnabled(true);
break;
case PHOTO_SHIFT_BOTH:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(true);
ui.toolButton_ShiftLeft->setEnabled(true);
ui.toolButton_ShiftRight->setEnabled(true);
break;
}
}

View File

@ -107,7 +107,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_ShiftLeft">
<widget class="QToolButton" name="toolButton_ShiftLeft">
<property name="text">
<string>&lt;&lt;</string>
</property>
@ -124,7 +124,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_ShiftRight">
<widget class="QToolButton" name="toolButton_ShiftRight">
<property name="text">
<string>&gt;&gt;</string>
</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);
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;
background: #0099cc;
border-radius: 4px;
max-height: 27px;
max-height: 20px;
min-width: 4em;
padding: 2px;
padding-left: 6px;
@ -1299,7 +1299,8 @@ PulseTopLevel QToolButton#toolButton_follow:hover, PulseViewGroup QToolButton#to
background: #03b1f3;
border-radius: 4px;
min-width: 4em;
padding: 2px;
padding-left: 6px;
padding-right: 6px;
}
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
@ -1310,9 +1311,11 @@ PulseAddDialog QPushButton#pushButton_Post:disabled {
color: white;
background: #d40000;
border-radius: 4px;
max-height: 27px;
max-height: 20px;
min-width: 4em;
padding: 2px;
padding-left: 6px;
padding-right: 6px;
}
ShareManager QPushButton#closeButton {
@ -1479,6 +1482,10 @@ WireGroupItem QFrame#wire_frame
background: transparent;
}
PulseReply #line_replyLine , PulseMessage #line{
color: #38444d;
}
RSTextBrowser, MimeTextEdit
{
/*qproperty-textColorQuote: rgb(125, 125, 255);*/
@ -1499,10 +1506,16 @@ MainWindow QListWidget {
font-size: 12pt;
}
ChatLobbyWidget QTreeWidget#lobbyTreeWidget{
font-size: 10pt;
}
NewFriendList QTreeView#peerTreeWidget {
PhotoShare QPushButton#pushButton_YourAlbums, QPushButton#pushButton_SubscribedAlbums,
QPushButton#pushButton_SharedAlbums {
font-size: 12pt;
}
PhotoItem QFrame#photoFrame{
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 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;
};