void WToolBar::addButton(WSplitButton *button) { setCompact(false); lastGroup_ = 0; impl_->addWidget(button); }
void CategoryWidget::onCompactChanged(bool _compact) { delete topLayout; delete mainLayout; topLayout = new QHBoxLayout; topLayout->setSpacing(0); topLayout->setMargin(0); Q_UNUSED(_compact); setCompact(true); nameLabel->minimizeMaximumWidth(); mainLayout = nullptr; container->setFixedHeight(25); container->setLayout(topLayout); topLayout->addSpacing(18); topLayout->addWidget(&statusPic); topLayout->addSpacing(5); topLayout->addWidget(nameLabel, 100); topLayout->addWidget(lineFrame, 1); topLayout->addSpacing(5); topLayout->addWidget(statusLabel); topLayout->addSpacing(5); topLayout->activate(); Style::repolish(this); }
void GenericChatroomWidget::compactChange(bool _compact) { if (!isCompact()) delete textLayout; // has to be first, deleted by layout setCompact(_compact); delete mainLayout; mainLayout = new QHBoxLayout; textLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->setSpacing(0); mainLayout->setMargin(0); textLayout->setSpacing(0); textLayout->setMargin(0); setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft // avatar if (isCompact()) { delete textLayout; // Not needed setFixedHeight(25); avatar->setSize(QSize(20, 20)); mainLayout->addSpacing(18); mainLayout->addWidget(avatar); mainLayout->addSpacing(5); mainLayout->addWidget(nameLabel); mainLayout->addWidget(statusMessageLabel); mainLayout->addSpacing(5); mainLayout->addWidget(&statusPic); mainLayout->addSpacing(5); mainLayout->activate(); statusMessageLabel->setFont(Style::getFont(Style::Small)); nameLabel->setFont(Style::getFont(Style::Medium)); } else { setFixedHeight(55); avatar->setSize(QSize(40, 40)); textLayout->addStretch(); textLayout->addWidget(nameLabel); textLayout->addWidget(statusMessageLabel); textLayout->addStretch(); mainLayout->addSpacing(20); mainLayout->addWidget(avatar); mainLayout->addSpacing(10); mainLayout->addLayout(textLayout); mainLayout->addSpacing(10); mainLayout->addWidget(&statusPic); mainLayout->addSpacing(10); mainLayout->activate(); statusMessageLabel->setFont(Style::getFont(Style::Medium)); nameLabel->setFont(Style::getFont(Style::Big)); } }
GenericChatroomWidget::GenericChatroomWidget(QWidget *parent) : QFrame(parent), compact{Settings::getInstance().getCompactLayout()}, active{false} { // avatar if (compact) avatar = new MaskablePixmapWidget(this, QSize(20,20), ":/img/avatar_mask.svg"); else avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.svg"); // status text statusMessageLabel = new CroppingLabel(this); statusMessageLabel->setTextFormat(Qt::PlainText); statusMessageLabel->setForegroundRole(QPalette::WindowText); // name text nameLabel = new CroppingLabel(this); nameLabel->setTextFormat(Qt::PlainText); nameLabel->setForegroundRole(QPalette::WindowText); setAutoFillBackground(true); reloadTheme(); setCompact(compact); }
void WToolBar::addSeparator() { setCompact(false); lastGroup_ = 0; }
CompactVBoxLayout::CompactVBoxLayout(QBoxLayout*parent): VBoxLayout(parent) { setCompact(); }
//________________________________________________________________ CompactVBoxLayout::CompactVBoxLayout() { setCompact(); }