mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
GuiPrefs:
- implement an UI to specify the size of InstantPreview images - change the default size to 1.0 because we've got many complaints that the former default size of 0.9 was too low Both changes fix #6176. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31425 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2fb10659a8
commit
cb71b8a8de
@ -243,7 +243,7 @@ void LyXRC::setDefaults()
|
||||
index_command = "makeindex -c -q";
|
||||
nomencl_command = "makeindex -s nomencl.ist";
|
||||
dpi = 75;
|
||||
// Because a screen typically is wider than a piece of paper:
|
||||
// Because a screen is typically wider than a piece of paper:
|
||||
zoom = 150;
|
||||
allow_geometry_session = true;
|
||||
// Default LaTeX font size:
|
||||
@ -306,7 +306,7 @@ void LyXRC::setDefaults()
|
||||
label_init_length = 3;
|
||||
preview = PREVIEW_OFF;
|
||||
preview_hashed_labels = false;
|
||||
preview_scale_factor = "0.9";
|
||||
preview_scale_factor = 1.0;
|
||||
use_converter_cache = true;
|
||||
use_tooltip = true;
|
||||
use_pixmap_cache = false;
|
||||
|
@ -423,7 +423,7 @@ public:
|
||||
///
|
||||
bool preview_hashed_labels;
|
||||
///
|
||||
std::string preview_scale_factor;
|
||||
double preview_scale_factor;
|
||||
/// user name
|
||||
std::string user_name;
|
||||
/// user email
|
||||
|
@ -1071,7 +1071,21 @@ PrefDisplay::PrefDisplay(GuiPreferences * form)
|
||||
setupUi(this);
|
||||
connect(displayGraphicsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
|
||||
connect(instantPreviewCO, SIGNAL(activated(int)), this, SIGNAL(changed()));
|
||||
connect(previewSizeSB, SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
|
||||
connect(paragraphMarkerCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
|
||||
if (instantPreviewCO->currentIndex() == 0)
|
||||
previewSizeSB->setEnabled(false);
|
||||
else
|
||||
previewSizeSB->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
void PrefDisplay::on_instantPreviewCO_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0)
|
||||
previewSizeSB->setEnabled(false);
|
||||
else
|
||||
previewSizeSB->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@ -1084,6 +1098,7 @@ void PrefDisplay::apply(LyXRC & rc) const
|
||||
}
|
||||
|
||||
rc.display_graphics = displayGraphicsCB->isChecked();
|
||||
rc.preview_scale_factor = previewSizeSB->value();
|
||||
rc.paragraph_markers = paragraphMarkerCB->isChecked();
|
||||
|
||||
// FIXME!! The graphics cache no longer has a changeDisplay method.
|
||||
@ -1112,6 +1127,7 @@ void PrefDisplay::update(LyXRC const & rc)
|
||||
|
||||
displayGraphicsCB->setChecked(rc.display_graphics);
|
||||
instantPreviewCO->setEnabled(rc.display_graphics);
|
||||
previewSizeSB->setValue(rc.preview_scale_factor);
|
||||
paragraphMarkerCB->setChecked(rc.paragraph_markers);
|
||||
}
|
||||
|
||||
|
@ -281,6 +281,9 @@ public:
|
||||
|
||||
void apply(LyXRC & rc) const;
|
||||
void update(LyXRC const & rc);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_instantPreviewCO_currentIndexChanged(int);
|
||||
};
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>340</width>
|
||||
<width>356</width>
|
||||
<height>133</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -20,14 +20,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="2" row="0" column="2" >
|
||||
<spacer>
|
||||
<item row="0" column="4" rowspan="4">
|
||||
<spacer name="spacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>57</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -62,6 +62,44 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="previewSizeLA">
|
||||
<property name="text">
|
||||
<string>Preview Si&ze:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>instantPreviewCO</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QDoubleSpinBox" name="previewSizeSB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>factor for the preview size</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="paragraphMarkerCB">
|
||||
<property name="text">
|
||||
@ -69,21 +107,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="2" row="0" column="2" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2" >
|
||||
<spacer>
|
||||
<item row="3" column="0">
|
||||
<spacer name="spacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
@ -390,7 +390,7 @@ PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b)
|
||||
: parent_(p), buffer_(b), font_scaling_factor_(0.0)
|
||||
{
|
||||
font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
|
||||
convert<double>(lyxrc.preview_scale_factor);
|
||||
lyxrc.preview_scale_factor;
|
||||
|
||||
LYXERR(Debug::GRAPHICS, "The font scaling factor is "
|
||||
<< font_scaling_factor_);
|
||||
|
Loading…
Reference in New Issue
Block a user