Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use separate labels for status and header #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions sources/chat-area/ChatArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ChatArea::ChatArea (Backend& backend, BackendChannel& channel, ChannelItem* tree
ui->listWidget->backend = &backend;

ui->titleLabel->setText (channel.display_name);
ui->statusLabel->setText (channel.getChannelDescription ());
ui->headerLabel->setText (channel.getChannelDescription ());

setTextEditWidgetHeight (texteditDefaultHeight);

Expand All @@ -79,9 +79,7 @@ ChatArea::ChatArea (Backend& backend, BackendChannel& channel, ChannelItem* tree
ui->statusLabel->setText (user->status);
});

if (ui->statusLabel->text().isEmpty()) {
ui->statusLabel->setText (user->status);
}
ui->statusLabel->setText (user->status);

} else {
ui->userAvatar->clear();
Expand Down Expand Up @@ -117,7 +115,7 @@ ChatArea::ChatArea (Backend& backend, BackendChannel& channel, ChannelItem* tree
connect (&channel, &BackendChannel::onUpdated, [this] {
ui->titleLabel->setText (this->channel.display_name);
this->treeItem->setLabel (this->channel.display_name);
ui->statusLabel->setText (this->channel.getChannelDescription ());
ui->headerLabel->setText (this->channel.getChannelDescription ());
});


Expand Down
27 changes: 26 additions & 1 deletion sources/chat-area/ChatArea.ui
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>TextLabel</string>
<string>Status</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -168,19 +168,44 @@
<property name="text">
<string>N members</string>
</property>
<property name="maximumWidth">
<number>120</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pinnedPostsButton">
<property name="text">
<string>N pinned posts</string>
</property>
<property name="maximumWidth">
<number>120</number>
</property>
<property name="icon">
<iconset>
<normaloff>:/img/pushpin.png</normaloff>:/img/pushpin.png</iconset>
</property>
</widget>
</item>
<item alignment="Qt::AlignBottom">
<widget class="QLabel" name="headerLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">padding-left:1px; padding-bottom: 3px</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>Channel header</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
Expand Down
Loading