aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-10-16 20:37:08 +0000
committerGravatar Fabio Bas2010-10-16 20:37:08 +0000
commitadce5cb7658ff21374ebafcb04f55b2da84406df (patch)
tree42edacb3055505a8b2c545e9537f1672223d1984 /src
parentadded OnInputBarPaste event (#995) (diff)
downloadKVIrc-adce5cb7658ff21374ebafcb04f55b2da84406df.tar.gz
KVIrc-adce5cb7658ff21374ebafcb04f55b2da84406df.tar.bz2
KVIrc-adce5cb7658ff21374ebafcb04f55b2da84406df.zip
implemented #987
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5082 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/config/kvi_shortcuts.h9
-rw-r--r--src/kvirc/ui/kvi_input_editor.cpp17
-rw-r--r--src/kvirc/ui/kvi_input_editor.h92
-rw-r--r--src/kvirc/ui/kvi_ircview.cpp18
4 files changed, 85 insertions, 51 deletions
diff --git a/src/kvilib/config/kvi_shortcuts.h b/src/kvilib/config/kvi_shortcuts.h
index 1b1ba23db..636bdebbe 100644
--- a/src/kvilib/config/kvi_shortcuts.h
+++ b/src/kvilib/config/kvi_shortcuts.h
@@ -118,6 +118,8 @@
* \def KVI_SHORTCUTS_WIN_PREV_PAGE Scroll the output window up one page
* \def KVI_SHORTCUTS_WIN_SCROLL_TO_LAST_READ_LINE Scroll to the last read line
* \def KVI_SHORTCUTS_WIN_SEARCH Open "Find Text" dialog
+* \def KVI_SHORTCUTS_WIN_ZOOM_IN Increase font size
+* \def KVI_SHORTCUTS_WIN_ZOOM_OUT Decrease font size
*/
// Please keep this list ordered by shortcut key and not by name :)
@@ -204,7 +206,8 @@
#define KVI_SHORTCUTS_INPUT_ESCAPE Qt::Key_Escape
#define KVI_SHORTCUTS_INPUT_DUMMY Qt::ShiftModifier + Qt::Key_Escape
#define KVI_SHORTCUTS_INPUT_DUMMY_2 Qt::ShiftModifier + Qt::Key_Delete
-
+#define KVI_SHORTCUTS_WIN_ZOOM_IN Qt::ControlModifier + Qt::Key_Plus
+#define KVI_SHORTCUTS_WIN_ZOOM_OUT Qt::ControlModifier + Qt::Key_Minus
/*
@doc: keyboard
@@ -239,6 +242,8 @@
[b]Ctrl+X:[/b] Cut to clipboard[br]
[b]Ctrl+Y:[/b] Toggle the commandline's KVS/User-friendly mode[br]
[b]Ctrl+Z:[/b] Undo last action[br]
+ [b]Ctrl+"+":[/b] Increase font size[br]
+ [b]Ctrl+"-":[/b] Decrease font size[br]
[b]Ctrl+Shift+A:[/b] Go away/back[br]
[b]Ctrl+Shift+B:[/b] Open "Manage Toolbars" dialog[br]
[b]Ctrl+Shift+C:[/b] Connect/disconnect current irc context[br]
@@ -257,7 +262,7 @@
[b]Ctrl+Shift+U:[/b] Open "Registered users" dialog[br]
[b]Ctrl+Shift+X:[/b] Open "Execute Script" dialog[br]
[b]Ctrl+Shift+Z:[/b] Redo last action[br]
-
+
[big]Window handling related keys:[/big][br]
[b]Alt+UpArrow:[/b] Previous window[br]
[b]Alt+DownArrow:[/b] Next window[br]
diff --git a/src/kvirc/ui/kvi_input_editor.cpp b/src/kvirc/ui/kvi_input_editor.cpp
index 4510421bb..fc5d77204 100644
--- a/src/kvirc/ui/kvi_input_editor.cpp
+++ b/src/kvirc/ui/kvi_input_editor.cpp
@@ -1333,6 +1333,23 @@ void KviInputEditor::installShortcuts()
new QShortcut(QKeySequence(KVI_SHORTCUTS_INPUT_COMMANDLINE),this,SLOT(toggleCommandMode()),0,Qt::WidgetShortcut);
new QShortcut(QKeySequence(KVI_SHORTCUTS_INPUT_DUMMY),this,SLOT(dummy()),0,Qt::WidgetShortcut);
new QShortcut(QKeySequence(KVI_SHORTCUTS_INPUT_DUMMY_2),this,SLOT(dummy()),0,Qt::WidgetShortcut);
+ new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_ZOOM_IN),this,SLOT(zoomIn()),0,Qt::WidgetShortcut);
+ new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_ZOOM_OUT),this,SLOT(zoomOut()),0,Qt::WidgetShortcut);
+
+}
+
+void KviInputEditor::zoomIn()
+{
+ if(m_pKviWindow)
+ if(m_pKviWindow->view())
+ m_pKviWindow->view()->increaseFontSize();
+}
+
+void KviInputEditor::zoomOut()
+{
+ if(m_pKviWindow)
+ if(m_pKviWindow->view())
+ m_pKviWindow->view()->decreaseFontSize();
}
void KviInputEditor::keyPressEvent(QKeyEvent * e)
diff --git a/src/kvirc/ui/kvi_input_editor.h b/src/kvirc/ui/kvi_input_editor.h
index 09d77a394..258ff2f57 100644
--- a/src/kvirc/ui/kvi_input_editor.h
+++ b/src/kvirc/ui/kvi_input_editor.h
@@ -561,175 +561,175 @@ private slots:
* \return void
*/
void openHistory();
-
+
/**
* \brief Toggles the multiline editor
* \return void
*/
void toggleMultiLineEditor();
-
+
/**
* \brief Moves to the previous character
* \return void
*/
void previousChar();
-
+
/**
* \brief Moves to the next character
* \return void
*/
void nextChar();
-
+
/**
* \brief Selects up to the previous character
* \return void
*/
void previousCharSelection();
-
+
/**
* \brief Selects up to the next character
* \return void
*/
void nextCharSelection();
-
+
/**
* \brief Moves to the beginning of the previous word
* \return void
*/
void previousWord();
-
+
/**
* \brief Moves to the end of the next word
* \return void
*/
void nextWord();
-
+
/**
* \brief Selects up to the beginning of the previous word
* \return void
*/
void previousWordSelection();
-
+
/**
* \brief Selects up to the end of the next word
* \return void
*/
void nextWordSelection();
-
+
/**
* \brief Inserts bold control character
* \return void
*/
void insertBold();
-
+
/**
* \brief Inserts reset control character
* \return void
*/
void insertReset();
-
+
/**
* \brief Inserts underline control character
* \return void
*/
void insertUnderline();
-
+
/**
* \brief Inserts reverse control character
* \return void
*/
void insertReverse();
-
+
/**
* \brief Inserts non-crypt (plain text) control character
* \return void
*/
void insertPlainText();
-
+
/**
* \brief Inserts icon control character
* \return void
*/
void insertIcon();
-
+
/**
* \brief Inserts color control character
* \return void
*/
void insertColor();
-
+
/**
* \brief Copies to clipboard
* \return void
*/
void copyInternal();
-
+
/**
* \brief Cuts to clipboard
* \return void
*/
void cutInternal();
-
+
/**
* \brief Pastes clipboard contents
* \return void
*/
void pasteInternal();
-
+
/**
* \brief Undoes last action
* \return void
*/
void undoInternal();
-
+
/**
* \brief Redoes last action
* \return void
*/
void redoInternal();
-
+
/**
* \brief Selects all
* \return void
*/
void selectAllInternal();
-
+
/**
* \brief Deletes last word
* \return void
*/
void deleteWord();
-
+
/**
* \brief Scrolls the output window up one line
* \return void
*/
void previousLine();
-
+
/**
* \brief Scrolls the output window down one line
* \return void
*/
void nextLine();
-
+
/**
* \brief Scrolls the output window up one page
* \return void
*/
void previousPage();
-
+
/**
* \brief Scrolls the output window down one page
* \return void
*/
void nextPage();
-
+
/**
* \brief Opens the search window
* \return void
*/
void search();
-
+
/**
* \brief Scrolls the ircview to the last read line
* \return void
@@ -741,61 +741,61 @@ private slots:
* \return void
*/
void sendPlain();
-
+
/**
* \brief Moves the cursor at the beginning
* \return void
*/
void homeInternal();
-
+
/**
* \brief Moves the cursor at the end
* \return void
*/
void endInternal();
-
+
/**
* \brief Selects until the beginning
* \return void
*/
void homeInternalSelection();
-
+
/**
* \brief Selects until the end
* \return void
*/
void endInternalSelection();
-
+
/**
* \brief Moves backward in the command history and in the history popup
* \return void
*/
void historyPrev();
-
+
/**
* \brief Moves forward in the command history and in the history popup
* \return void
*/
void historyNext();
-
+
/**
* \brief Run when return/enter key is pressed
* \return void
*/
void returnHit();
-
+
/**
* \brief Run when backspace key is pressed
* \return void
*/
void backspaceHit();
-
+
/**
* \brief Run when delete key is pressed
* \return void
*/
void deleteHit();
-
+
/**
* \brief Run when escape key is pressed
* \return void
@@ -807,13 +807,25 @@ private slots:
* \return void
*/
void toggleCommandMode();
-
+
/**
* \brief Does nothing but grabs some keys combinations
* \warning This is an hack. The keys combinations grabbed by this function write a non-printable chars which cause some troubles, eg duplication of chars opening/closing more times the multiline
* \return void
*/
void dummy();
+
+ /**
+ * \brief Increase the ircview font size
+ * \return void
+ */
+ void zoomIn();
+
+ /**
+ * \brief Decrease the ircview font size
+ * \return void
+ */
+ void zoomOut();
protected:
void completionEscapeUnsafeToken(QString &szToken);
void installShortcuts();
diff --git a/src/kvirc/ui/kvi_ircview.cpp b/src/kvirc/ui/kvi_ircview.cpp
index f2b9ca79f..a9efe7c27 100644
--- a/src/kvirc/ui/kvi_ircview.cpp
+++ b/src/kvirc/ui/kvi_ircview.cpp
@@ -1063,7 +1063,7 @@ void KviIrcView::paintEvent(QPaintEvent *p)
} else {
#endif
pa.fillRect(r,KVI_OPTION_COLOR(KviOption_colorIrcViewBackground));
-
+
QPixmap * pix = m_pPrivateBackgroundPixmap;
if(!pix)
@@ -1650,11 +1650,11 @@ void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
ptr->pBlocks[ptr->iBlockCount].block_width = curBlockWidth;
curAttrBlock++;
ptr->iBlockCount++;
-
+
// if we have no more blocks, return (with is ok)
if(curAttrBlock >= ptr->uChunkCount)
return;
-
+
//Process the next block of data in the next loop
ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock));
ptr->pBlocks[ptr->iBlockCount].block_start = ptr->pChunks[curAttrBlock].iTextStart;
@@ -1675,7 +1675,7 @@ void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth)
curBlockLen--;
curLineWidth -= IRCVIEW_WCHARWIDTH(*p);
}
-
+
// Now look for a space (or a tabulation)
while((p->unicode() != ' ') && (p->unicode() != '\t') && (curBlockLen > 0))
{
@@ -2159,7 +2159,7 @@ void KviIrcView::ensureLineVisible(KviIrcViewLine * pLineToShow)
repaint();
return;
}
-
+
// need to scroll
int sc = m_pScrollBar->value();
@@ -2168,7 +2168,7 @@ void KviIrcView::ensureLineVisible(KviIrcViewLine * pLineToShow)
// The cursor line is below the current line
// Go down counting scroll steps (and verify if the line is really there)
KviIrcViewLine * pLine = m_pCurLine;
-
+
while(pLine && (pLine != pLineToShow))
{
pLine = pLine->pNext;
@@ -2439,7 +2439,7 @@ int KviIrcView::getVisibleCharIndexAt(KviIrcViewLine *, int xPos, int yPos)
if(i >= l->iBlockCount)
return l->szText.size();
-
+
//run up to the chunk containing the mouse position
for(;iLeft + l->pBlocks[i].block_width < xPos;)
{
@@ -2753,10 +2753,10 @@ void KviIrcView::animatedIconChange()
void KviIrcView::scrollToMarker()
{
KviIrcViewLine * pLine = m_pCurLine;
-
+
while(pLine && (pLine->uIndex != m_uLineMarkLineIndex))
pLine = pLine->pPrev;
-
+
if(pLine == 0)
{
// The buffer has already cleaned the marker line