Added Split Text for Compose Message

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2125 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-25 15:36:24 +00:00
parent bb3a1ba8b1
commit 777b52753a
5 changed files with 83 additions and 24 deletions

View File

@ -366,6 +366,7 @@
<file>images/textedit/format_font_size_less.png</file> <file>images/textedit/format_font_size_less.png</file>
<file>images/textedit/hi22-action-format-text-blockquote.png</file> <file>images/textedit/hi22-action-format-text-blockquote.png</file>
<file>images/textedit/hi22-action-format-text-code.png</file> <file>images/textedit/hi22-action-format-text-code.png</file>
<file>images/textedit/hi22-action-insert-more-mark.png</file>
<file>images/toaster/chat.png</file> <file>images/toaster/chat.png</file>
<file>images/toaster/hangup.png</file> <file>images/toaster/hangup.png</file>
<file>images/toaster/pickup.png</file> <file>images/toaster/pickup.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -92,6 +92,8 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
connect(ui.sizedecreaseButton, SIGNAL (clicked()), this, SLOT (fontSizeDecrease())); connect(ui.sizedecreaseButton, SIGNAL (clicked()), this, SLOT (fontSizeDecrease()));
connect(ui.blockquoteButton, SIGNAL (clicked()), this, SLOT (blockQuote())); connect(ui.blockquoteButton, SIGNAL (clicked()), this, SLOT (blockQuote()));
connect(ui.codeButton, SIGNAL (clicked()), this, SLOT (toggleCode())); connect(ui.codeButton, SIGNAL (clicked()), this, SLOT (toggleCode()));
connect(ui.splitPostButton, SIGNAL (clicked()), this, SLOT (addPostSplitter()));
connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)), connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
this, SLOT(currentCharFormatChanged(const QTextCharFormat &))); this, SLOT(currentCharFormatChanged(const QTextCharFormat &)));
@ -1141,6 +1143,22 @@ void ChanMsgDialog::toggleCode()
ui.msgText->setFocus( Qt::OtherFocusReason ); ui.msgText->setFocus( Qt::OtherFocusReason );
} }
void ChanMsgDialog::addPostSplitter()
{
QTextBlockFormat f = ui.msgText->textCursor().blockFormat();
QTextBlockFormat f1 = f;
f.setProperty( TextFormat::IsHtmlTagSign, true );
f.setProperty( QTextFormat::BlockTrailingHorizontalRulerWidth,
QTextLength( QTextLength::PercentageLength, 80 ) );
if ( ui.msgText->textCursor().block().text().isEmpty() ) {
ui.msgText->textCursor().mergeBlockFormat( f );
} else {
ui.msgText->textCursor().insertBlock( f );
}
ui.msgText->textCursor().insertBlock( f1 );
}
void ChanMsgDialog::attachFile() void ChanMsgDialog::attachFile()
{ {
// select a file // select a file

View File

@ -19,7 +19,6 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#ifndef _CHAN_MSG_DIALOG_H #ifndef _CHAN_MSG_DIALOG_H
#define _CHAN_MSG_DIALOG_H #define _CHAN_MSG_DIALOG_H
@ -116,6 +115,7 @@ private slots:
void fontSizeDecrease(); void fontSizeDecrease();
void blockQuote(); void blockQuote();
void toggleCode(); void toggleCode();
void addPostSplitter();
private: private:

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>874</width> <width>769</width>
<height>528</height> <height>485</height>
</rect> </rect>
</property> </property>
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
@ -151,17 +151,34 @@ border: 1px solid #CCCCCC;}</string>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout_5">
<property name="margin"> <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="horizontalSpacing">
<number>1</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QComboBox" name="comboStyle"/> <widget class="QComboBox" name="comboStyle">
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
</property>
</widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QFontComboBox" name="comboFont"/> <widget class="QFontComboBox" name="comboFont">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QComboBox" name="comboSize"> <widget class="QComboBox" name="comboSize">
@ -176,19 +193,6 @@ border: 1px solid #CCCCCC;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="15">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QToolButton" name="blockquoteButton"> <widget class="QToolButton" name="blockquoteButton">
<property name="toolTip"> <property name="toolTip">
@ -384,7 +388,7 @@ border: 1px solid #CCCCCC;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="10"> <item row="0" column="11">
<widget class="QToolButton" name="colorbtn"> <widget class="QToolButton" name="colorbtn">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -409,7 +413,7 @@ border: 1px solid #CCCCCC;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="11"> <item row="0" column="12">
<widget class="QToolButton" name="textalignmentbtn"> <widget class="QToolButton" name="textalignmentbtn">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -443,7 +447,7 @@ border: 1px solid #CCCCCC;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="12"> <item row="0" column="13">
<widget class="QToolButton" name="imagebtn"> <widget class="QToolButton" name="imagebtn">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -501,6 +505,42 @@ border: 1px solid #CCCCCC;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="16">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="10">
<widget class="QToolButton" name="splitPostButton">
<property name="toolTip">
<string>Split text</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/hi22-action-insert-more-mark.png</normaloff>:/images/textedit/hi22-action-insert-more-mark.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -521,7 +561,7 @@ border: 1px solid #CCCCCC;}</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget_1">
<layout class="QGridLayout" name="layoutrecommended"> <layout class="QGridLayout" name="layoutrecommended">
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
@ -597,7 +637,7 @@ border: 1px solid #CCCCCC;}</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>874</width> <width>769</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>