Merge pull request #1964 from defnax/Chat-widget

Moved Fonts to bottom & Chat notify to top
This commit is contained in:
defnax 2020-05-22 12:20:12 +02:00 committed by GitHub
commit d6748b17d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 6 deletions

View File

@ -115,6 +115,7 @@ ChatWidget::ChatWidget(QWidget *parent)
//ui->sendButton->setFixedHeight(iconHeight); //ui->sendButton->setFixedHeight(iconHeight);
ui->sendButton->setIconSize(iconSize); ui->sendButton->setIconSize(iconSize);
ui->typingLabel->setMaximumHeight(QFontMetricsF(font()).height()*1.2); ui->typingLabel->setMaximumHeight(QFontMetricsF(font()).height()*1.2);
ui->fontcolorButton->setIconSize(iconSize);
//Initialize search //Initialize search
iCharToStartSearch=Settings->getChatSearchCharToStartSearch(); iCharToStartSearch=Settings->getChatSearchCharToStartSearch();
@ -189,7 +190,7 @@ ChatWidget::ChatWidget(QWidget *parent)
ui->hashBox->setDropWidget(this); ui->hashBox->setDropWidget(this);
ui->hashBox->setAutoHide(true); ui->hashBox->setAutoHide(true);
QMenu *fontmenu = new QMenu(tr("Set text font & color")); QMenu *fontmenu = new QMenu();
fontmenu->addAction(ui->actionChooseFont); fontmenu->addAction(ui->actionChooseFont);
fontmenu->addAction(ui->actionChooseColor); fontmenu->addAction(ui->actionChooseColor);
fontmenu->addAction(ui->actionResetFont); fontmenu->addAction(ui->actionResetFont);
@ -198,10 +199,10 @@ ChatWidget::ChatWidget(QWidget *parent)
#ifdef USE_CMARK #ifdef USE_CMARK
fontmenu->addAction(ui->actionSend_as_CommonMark); fontmenu->addAction(ui->actionSend_as_CommonMark);
#endif #endif
ui->fontcolorButton->setMenu(fontmenu);
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
menu->addAction(ui->actionMessageHistory); menu->addAction(ui->actionMessageHistory);
menu->addMenu(fontmenu);
menu->addSeparator(); menu->addSeparator();
menu->addAction(ui->actionSaveChatHistory); menu->addAction(ui->actionSaveChatHistory);
menu->addAction(ui->actionClearChatHistory); menu->addAction(ui->actionClearChatHistory);

View File

@ -455,13 +455,13 @@ border-image: url(:/images/closepressed.png)
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="notifyButton"> <widget class="QToolButton" name="fontcolorButton">
<property name="focusPolicy"> <property name="toolTip">
<enum>Qt::NoFocus</enum> <string>Set font &amp; color</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../icons.qrc"> <iconset resource="../icons.qrc">
<normaloff>:/icons/png/chat-bubble-notify.png</normaloff>:/icons/png/chat-bubble-notify.png</iconset> <normaloff>:/icons/png/font.png</normaloff>:/icons/png/font.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -469,6 +469,9 @@ border-image: url(:/images/closepressed.png)
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -769,6 +772,26 @@ border-image: url(:/images/closepressed.png)
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="notifyButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/chat-bubble-notify.png</normaloff>:/icons/png/chat-bubble-notify.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="pushtoolsButton"> <widget class="QToolButton" name="pushtoolsButton">
<property name="focusPolicy"> <property name="focusPolicy">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB