Fixing layout issues & added to store ratio combox

* Fixing layout issues
* Added to store/load ratio combox
This commit is contained in:
defnax 2020-09-12 14:08:18 +02:00
parent 96cbbce3b1
commit 14a5c82442
3 changed files with 221 additions and 216 deletions

View File

@ -80,6 +80,11 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
connect(generateCheckBox, SIGNAL(toggled(bool)), generateSpinBox, SLOT(setEnabled(bool)));
connect(aspectRatio_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(changeAspectRatio(int)));
channelpostButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png"));
addThumbnailButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-image.png"));
addfilepushButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-file.png"));
aspectRatio_CB->setItemIcon(0,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-auto.svg"));
aspectRatio_CB->setItemIcon(1,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-1-1.svg"));
aspectRatio_CB->setItemIcon(2,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-3-4.svg"));
@ -106,6 +111,9 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
generateCheckBox->hide();
generateSpinBox->hide();
#endif
/* load settings */
processSettings(true);
}
CreateGxsChannelMsg::~CreateGxsChannelMsg()
@ -114,6 +122,29 @@ CreateGxsChannelMsg::~CreateGxsChannelMsg()
#ifdef CHANNELS_FRAME_CATCHER
delete fCatcher;
#endif
// save settings
processSettings(false);
}
void CreateGxsChannelMsg::processSettings(bool load)
{
Settings->beginGroup(QString("CreateGxsChannelMsg"));
if (load) {
// load settings
// state of Ratio combobox
int index = Settings->value("aspectRatio_CB", 0).toInt();
aspectRatio_CB->setCurrentIndex(index);
} else {
// save settings
// state of Ratio combobox
Settings->setValue("aspectRatio_CB", aspectRatio_CB->currentIndex());
}
Settings->endGroup();
}
void CreateGxsChannelMsg::changeAspectRatio(int s)

View File

@ -72,6 +72,7 @@ private slots:
void on_channelpostButton_clicked();
void on_attachmentsButton_clicked();
private:
void processSettings(bool load);
void loadChannelInfo();
void loadOriginalChannelPostInfo();
void saveChannelInfo(const RsGroupMetaData &group);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>881</width>
<height>383</height>
<height>328</height>
</rect>
</property>
<property name="acceptDrops">
@ -39,13 +39,6 @@
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="HeaderFrame" name="headerFrame">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="mainFrame">
<property name="frameShape">
@ -64,6 +57,19 @@
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QPushButton" name="attachmentsButton">
<property name="text">
<string>Attachments</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QStackedWidget" name="stackedWidget">
<property name="mouseTracking">
@ -79,10 +85,14 @@
<number>0</number>
</property>
<widget class="QWidget" name="stackedWidgetPage1">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item row="0" column="0" rowspan="4">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ChannelPostThumbnailView" name="preview_W" native="true">
@ -102,19 +112,14 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="channelNameHLayout">
<property name="topMargin">
<number>6</number>
@ -150,7 +155,7 @@
</item>
</layout>
</item>
<item>
<item row="1" column="1">
<widget class="QLabel" name="channelAttachLabel">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -163,17 +168,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="addThumbnailButton">
<property name="text">
<string>Add Channel Thumbnail</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/icons/png/add-image.png</normaloff>:/icons/png/add-image.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
@ -217,10 +218,6 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string>Add File to Attach</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/icons/png/add-file.png</normaloff>:/icons/png/add-file.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
@ -247,7 +244,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<item row="3" column="1">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="topMargin">
<number>9</number>
@ -261,25 +258,15 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="4" column="0" colspan="2">
<widget class="RichTextEdit" name="RichTextEditWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="RichTextEdit" name="RichTextEditWidget" native="true"/>
</widget>
</item>
</layout>
</widget>
@ -342,7 +329,7 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>84</width>
<width>842</width>
<height>24</height>
</rect>
</property>
@ -416,23 +403,6 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="channelpostButton">
<property name="text">
<string>Channel Post</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/icons/png/comment.png</normaloff>:/icons/png/comment.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
@ -446,14 +416,10 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="attachmentsButton">
<item row="0" column="0">
<widget class="QPushButton" name="channelpostButton">
<property name="text">
<string>Attachments</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/icons/png/attachements.png</normaloff>:/icons/png/attachements.png</iconset>
<string>Channel Post</string>
</property>
<property name="iconSize">
<size>
@ -500,6 +466,13 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="HeaderFrame" name="headerFrame">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>