Summary: | Changes to"highlighting text styles" colors not remembered | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Matthew Woehlke <mwoehlke.floss> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Previous changes in a useful format |
Description
Matthew Woehlke
2005-12-02 01:57:56 UTC
NOTE: The above diffs are backwards; sorry about that Created attachment 13741 [details]
Previous changes in a useful format
Ok, clearly I'm still figuring out how to give useful diff's. Hopefully the
attached form is more useful!
SVN commit 555481 by dhaumann: fix: make it possible to reset the background and selected background color. Matthew Woehlke, please try again with upcoming KDE 3.5.4. BUG:117479 M +1 -0 kateschema.cpp --- branches/KDE/3.5/kdelibs/kate/part/kateschema.cpp #555480:555481 @@ -1450,6 +1450,7 @@ is->clearAttribute(KateAttribute::BGColor); else if ( c == 101 && is->itemSet(KateAttribute::SelectedBGColor) ) is->clearAttribute(KateAttribute::SelectedBGColor); + updateStyle(); } void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int col, int width, int align ) SVN commit 555680 by dhaumann: forward port SVN commit 511726 by alund: Make updateStyle() work: colors can be unset, and so can other items if we reset to default (oh, and call it too in the latter case) CCBUG: 117479 M +11 -0 katestyletreewidget.cpp --- trunk/KDE/kdelibs/kate/part/katestyletreewidget.cpp #555679:555680 @@ -464,54 +464,63 @@ if ( currentStyle->fontWeight() != actualStyle->fontWeight()) actualStyle->setFontWeight( currentStyle->fontWeight() ); } + else actualStyle->clearProperty( QTextFormat::FontWeight ); if ( currentStyle->hasProperty(QTextFormat::FontItalic) ) { if ( currentStyle->fontItalic() != actualStyle->fontItalic()) actualStyle->setFontItalic( currentStyle->fontItalic() ); } + else actualStyle->clearProperty( QTextFormat::FontItalic ); if ( currentStyle->hasProperty(QTextFormat::FontStrikeOut) ) { if ( currentStyle->fontStrikeOut() != actualStyle->fontStrikeOut()) actualStyle->setFontStrikeOut( currentStyle->fontStrikeOut() ); } + else actualStyle->clearProperty( QTextFormat::FontStrikeOut ); if ( currentStyle->hasProperty(QTextFormat::FontUnderline) ) { if ( currentStyle->fontUnderline() != actualStyle->fontUnderline()) actualStyle->setFontUnderline( currentStyle->fontUnderline() ); } + else actualStyle->clearProperty( QTextFormat::FontUnderline ); if ( currentStyle->hasProperty(KTextEditor::Attribute::Outline) ) { if ( currentStyle->outline() != actualStyle->outline()) actualStyle->setOutline( currentStyle->outline() ); } + else actualStyle->clearProperty( KTextEditor::Attribute::Outline ); if ( currentStyle->hasProperty(QTextFormat::ForegroundBrush) ) { if ( currentStyle->foreground() != actualStyle->foreground()) actualStyle->setForeground( currentStyle->foreground() ); } + else actualStyle->clearProperty( QTextFormat::ForegroundBrush ); if ( currentStyle->hasProperty(KTextEditor::Attribute::SelectedForeground) ) { if ( currentStyle->selectedForeground() != actualStyle->selectedForeground()) actualStyle->setSelectedForeground( currentStyle->selectedForeground() ); } + else actualStyle->clearProperty( KTextEditor::Attribute::SelectedForeground ); if ( currentStyle->hasProperty(QTextFormat::BackgroundBrush) ) { if ( currentStyle->background() != actualStyle->background()) actualStyle->setBackground( currentStyle->background() ); } + else actualStyle->clearProperty( QTextFormat::BackgroundBrush ); if ( currentStyle->hasProperty(KTextEditor::Attribute::SelectedBackground) ) { if ( currentStyle->selectedBackground() != actualStyle->selectedBackground()) actualStyle->setSelectedBackground( currentStyle->selectedBackground() ); } + else actualStyle->clearProperty( KTextEditor::Attribute::SelectedBackground ); } /* only true for a hl mode item using it's default style */ @@ -550,6 +559,7 @@ } else { currentStyle = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute( *defaultStyle )); + updateStyle(); //FIXME //repaint(); } @@ -645,6 +655,7 @@ currentStyle->clearProperty(QTextFormat::BackgroundBrush); else if ( c == 101 && currentStyle->hasProperty(KTextEditor::Attribute::SelectedBackground) ) currentStyle->clearProperty(KTextEditor::Attribute::SelectedBackground); + updateStyle(); } KateStyleTreeWidget* KateStyleTreeWidgetItem::treeWidget() const |