Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 25f40c15 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Hide & show rulers with ctrl-r, remember whether they were shown or hidden.

svn path=/trunk/koffice/; revision=443313
parent cb16544f
......@@ -171,6 +171,15 @@ void KisConfig::setDither8Bit(bool dither8Bit)
m_cfg -> writeEntry("dither8Bit", dither8Bit);
}
bool KisConfig::showRulers() const
{
return m_cfg->readBoolEntry("showrulers", false);
}
void KisConfig::setShowRulers(bool rulers)
{
m_cfg->writeEntry("showrulers", rulers);
}
bool KisConfig::askProfileOnOpen() const
{
......
......@@ -58,6 +58,9 @@ public:
bool dither8Bit() const;
void setDither8Bit(bool dither8Bit);
bool showRulers() const;
void setShowRulers(bool rulers);
bool askProfileOnOpen() const;
void setAskProfileOnOpen(bool askProfileOnOpen);
......
......@@ -238,6 +238,9 @@ KisView::KisView(KisDoc *doc, KisUndoAdapter *adapter, QWidget *parent, const ch
KisView::~KisView()
{
KisConfig cfg;
cfg.setShowRulers( m_RulerAction->isChecked() );
delete m_dcop;
delete m_paletteManager;
delete m_selectionManager;
......@@ -449,6 +452,8 @@ void KisView::setupStatusBar()
void KisView::setupActions()
{
KisConfig cfg;
m_selectionManager->setup(actionCollection());
m_filterManager->setup(actionCollection());
......@@ -496,15 +501,16 @@ void KisView::setupActions()
// setting actions
KStdAction::preferences(this, SLOT(preferences()), actionCollection(), "preferences");
m_RulerAction = new KToggleAction( i18n( "Show Rulers" ), 0, this, SLOT( showRuler() ), actionCollection(), "view_ruler" );
m_RulerAction = new KToggleAction( i18n( "Show Rulers" ), "Ctrl+R", this, SLOT( showRuler() ), actionCollection(), "view_ruler" );
m_RulerAction->setChecked(cfg.showRulers());
m_RulerAction->setCheckedState(i18n("Hide Rulers"));
m_RulerAction->setToolTip( i18n( "Shows or hides rulers." ) );
m_RulerAction->setWhatsThis( i18n("The rulers are the white measuring spaces top and left of the "
"document. The rulers show the position and width of pages and of frames and can "
"be used to position tabulators among others.<p>Uncheck this to disable "
"the rulers from being displayed." ) );
showRuler();
m_RulerAction->setChecked( true );
}
void KisView::resizeEvent(QResizeEvent *)
......@@ -631,6 +637,11 @@ void KisView::resizeEvent(QResizeEvent *)
m_hRuler -> show();
m_vRuler -> show();
}
else {
m_hRuler -> hide();
m_vRuler -> hide();
}
}
void KisView::updateReadWrite(bool readwrite)
......@@ -1374,7 +1385,6 @@ void KisView::layerCompositeOp(const KisCompositeOp& compositeOp)
// range: 0 - 100
void KisView::layerOpacity(int opacity)
{
kdDebug(DBG_AREA_CORE) << "Opacity set to " << opacity << endl;
KisImageSP img = currentImg();
if (!img) return;
......@@ -1479,7 +1489,6 @@ void KisView::gradientActivated(KisResource *gradient)
void KisView::paintopActivated(const KisID & paintop)
{
kdDebug(DBG_AREA_CORE) << "paintop activated: " << paintop.name() << "\n";
if (paintop.id().isNull() || paintop.id().isEmpty()) {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment