Add action buttons to PostWidget.
This commit is contained in:
parent
a6ef2aca31
commit
bc293a2c61
|
@ -23,7 +23,7 @@ void PostWidget::show_hide_elements()
|
||||||
{
|
{
|
||||||
const bool has_subject{!label_subject->text().isEmpty()};
|
const bool has_subject{!label_subject->text().isEmpty()};
|
||||||
label_subject->setVisible(has_subject);
|
label_subject->setVisible(has_subject);
|
||||||
button_more->setVisible(has_subject);
|
button_show_more->setVisible(has_subject);
|
||||||
label_content->setHidden(has_subject);
|
label_content->setHidden(has_subject);
|
||||||
|
|
||||||
if (label_avatar->pixmap() == nullptr)
|
if (label_avatar->pixmap() == nullptr)
|
||||||
|
@ -32,7 +32,7 @@ void PostWidget::show_hide_elements()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostWidget::toggled_button(const bool &toggled)
|
void PostWidget::toggled_button_show_more(const bool &toggled)
|
||||||
{
|
{
|
||||||
label_content->setVisible(toggled);
|
label_content->setVisible(toggled);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
void show_hide_elements();
|
void show_hide_elements();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void toggled_button(const bool &toggled);
|
void toggled_button_show_more(const bool &toggled);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace FediPotato
|
} // namespace FediPotato
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="button_more">
|
<widget class="QPushButton" name="button_show_more">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -212,6 +212,84 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="hbox_buttons">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_boost">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>🔁</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_fav">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>⭐</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_bookmark">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>🔖</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_more_actions">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -219,10 +297,10 @@
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>button_more</sender>
|
<sender>button_show_more</sender>
|
||||||
<signal>toggled(bool)</signal>
|
<signal>toggled(bool)</signal>
|
||||||
<receiver>PostWidget</receiver>
|
<receiver>PostWidget</receiver>
|
||||||
<slot>toggled_button(bool)</slot>
|
<slot>toggled_button_show_more(bool)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>113</x>
|
<x>113</x>
|
||||||
|
@ -236,6 +314,6 @@
|
||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>toggled_button(bool)</slot>
|
<slot>toggled_button_show_more(bool)</slot>
|
||||||
</slots>
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Reference in New Issue