Add View menu entries for adjusting font size. Make sure that the result table position does not change when changing font size
This commit is contained in:
parent
8da0bf28cc
commit
ec389f89f5
@ -67,6 +67,8 @@ void RclMain::buildMenus()
|
|||||||
|
|
||||||
viewMenu->addSeparator();
|
viewMenu->addSeparator();
|
||||||
viewMenu->addAction(toggleFullScreenAction);
|
viewMenu->addAction(toggleFullScreenAction);
|
||||||
|
viewMenu->addAction(zoomInAction);
|
||||||
|
viewMenu->addAction(zoomOutAction);
|
||||||
|
|
||||||
toolsMenu->addAction(toolsDoc_HistoryAction);
|
toolsMenu->addAction(toolsDoc_HistoryAction);
|
||||||
toolsMenu->addAction(toolsAdvanced_SearchAction);
|
toolsMenu->addAction(toolsAdvanced_SearchAction);
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>25</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
@ -346,6 +346,28 @@
|
|||||||
<cstring>toggleFullScreenAction</cstring>
|
<cstring>toggleFullScreenAction</cstring>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="zoomInAction">
|
||||||
|
<property name="text">
|
||||||
|
<string>Increase results text font size</string>
|
||||||
|
</property>
|
||||||
|
<property name="iconText">
|
||||||
|
<string>Increase Font Size</string>
|
||||||
|
</property>
|
||||||
|
<property name="name" stdset="0">
|
||||||
|
<cstring>zoomInAction</cstring>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="zoomOutAction">
|
||||||
|
<property name="text">
|
||||||
|
<string>Decrease results text font size</string>
|
||||||
|
</property>
|
||||||
|
<property name="iconText">
|
||||||
|
<string>Decrease Font Size</string>
|
||||||
|
</property>
|
||||||
|
<property name="name" stdset="0">
|
||||||
|
<cstring>zoomOutAction</cstring>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="actionSortByDateAsc">
|
<action name="actionSortByDateAsc">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|||||||
@ -240,8 +240,12 @@ void RclMain::init()
|
|||||||
connect(enbSynAction, SIGNAL(toggled(bool)),
|
connect(enbSynAction, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(setSynEnabled(bool)));
|
this, SLOT(setSynEnabled(bool)));
|
||||||
|
|
||||||
connect(toggleFullScreenAction, SIGNAL(triggered()),
|
connect(toggleFullScreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
|
||||||
this, SLOT(toggleFullScreen()));
|
zoomInAction->setShortcut(QKeySequence::ZoomIn);
|
||||||
|
connect(zoomInAction, SIGNAL(triggered()), this, SLOT(zoomIn()));
|
||||||
|
zoomOutAction->setShortcut(QKeySequence::ZoomOut);
|
||||||
|
connect(zoomOutAction, SIGNAL(triggered()), this, SLOT(zoomOut()));
|
||||||
|
|
||||||
connect(actionShowQueryDetails, SIGNAL(triggered()),
|
connect(actionShowQueryDetails, SIGNAL(triggered()),
|
||||||
reslist, SLOT(showQueryDetails()));
|
reslist, SLOT(showQueryDetails()));
|
||||||
connect(periodictimer, SIGNAL(timeout()),
|
connect(periodictimer, SIGNAL(timeout()),
|
||||||
@ -288,8 +292,6 @@ void RclMain::init()
|
|||||||
connect(this, SIGNAL(resultsReady()),
|
connect(this, SIGNAL(resultsReady()),
|
||||||
reslist, SLOT(readDocSource()));
|
reslist, SLOT(readDocSource()));
|
||||||
connect(this, SIGNAL(uiPrefsChanged()), reslist, SLOT(onUiPrefsChanged()));
|
connect(this, SIGNAL(uiPrefsChanged()), reslist, SLOT(onUiPrefsChanged()));
|
||||||
connect(new QShortcut(QKeySequence::ZoomIn,this), SIGNAL (activated()), this, SLOT (zoomIn()));
|
|
||||||
connect(new QShortcut(QKeySequence::ZoomOut,this),SIGNAL (activated()), this, SLOT (zoomOut()));
|
|
||||||
|
|
||||||
connect(reslist, SIGNAL(hasResults(int)),
|
connect(reslist, SIGNAL(hasResults(int)),
|
||||||
this, SLOT(resultCount(int)));
|
this, SLOT(resultCount(int)));
|
||||||
|
|||||||
@ -438,19 +438,17 @@ void ResList::onUiPrefsChanged()
|
|||||||
void ResList::setFont()
|
void ResList::setFont()
|
||||||
{
|
{
|
||||||
#if defined(USING_WEBKIT) || defined(USING_WEBENGINE)
|
#if defined(USING_WEBKIT) || defined(USING_WEBENGINE)
|
||||||
# ifndef SETFONT_WITH_HEADSTYLE
|
#ifndef SETFONT_WITH_HEADSTYLE
|
||||||
if (prefs.reslistfontfamily != "") {
|
if (prefs.reslistfontfamily != "") {
|
||||||
// For some reason there is (12-2014) an offset of 3 between what
|
// For some reason there is (12-2014) an offset of 3 between what
|
||||||
// we request from webkit and what we get.
|
// we request from webkit and what we get.
|
||||||
settings()->setFontSize(QWEBSETTINGS::DefaultFontSize,
|
settings()->setFontSize(QWEBSETTINGS::DefaultFontSize, prefs.reslistfontsize + 3);
|
||||||
prefs.reslistfontsize + 3);
|
settings()->setFontFamily(QWEBSETTINGS::StandardFont, prefs.reslistfontfamily);
|
||||||
settings()->setFontFamily(QWEBSETTINGS::StandardFont,
|
|
||||||
prefs.reslistfontfamily);
|
|
||||||
} else {
|
} else {
|
||||||
settings()->setFontSize(QWEBSETTINGS::DefaultFontSize, prefs.reslistfontsize + 3);
|
settings()->setFontSize(QWEBSETTINGS::DefaultFontSize, prefs.reslistfontsize + 3);
|
||||||
settings()->resetFontFamily(QWEBSETTINGS::StandardFont);
|
settings()->resetFontFamily(QWEBSETTINGS::StandardFont);
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
#else
|
#else
|
||||||
if (prefs.reslistfontfamily != "") {
|
if (prefs.reslistfontfamily != "") {
|
||||||
QFont nfont(prefs.reslistfontfamily, prefs.reslistfontsize);
|
QFont nfont(prefs.reslistfontfamily, prefs.reslistfontsize);
|
||||||
|
|||||||
@ -811,10 +811,12 @@ void ResTable::onUiPrefsChanged()
|
|||||||
if (m_detail) {
|
if (m_detail) {
|
||||||
m_detail->setFont();
|
m_detail->setFont();
|
||||||
}
|
}
|
||||||
// Not sure that this is the right way, but something is needed to
|
auto index = tableView->indexAt(QPoint(0, 0));
|
||||||
// repaint with a possible new font. Toggling alternaterowcolors
|
// There may be a better way to force repainting all visible rows
|
||||||
// works too
|
// with the possibly new font, but this works...
|
||||||
tableView->update(tableView->indexAt(QPoint(0, 0)));
|
tableView->setAlternatingRowColors(false);
|
||||||
|
tableView->setAlternatingRowColors(true);
|
||||||
|
makeRowVisible(index.row());
|
||||||
if (prefs.noResTableHeader) {
|
if (prefs.noResTableHeader) {
|
||||||
tableView->horizontalHeader()->hide();
|
tableView->horizontalHeader()->hide();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user