KDE/kdelibs

Christoph Cullmann cullmann at kde.org
Sun Jul 4 07:42:02 UTC 2010


SVN commit 1145806 by cullmann:

cullmann:
    define z depths for the most common ranges in kate part, as discussed on kwrite-devel some weeks ago
    implementation should work, too, now
    
CCMAIL: kwrite-devel at kde.org
CCMAIL: kdevelop-devel at barney.cs.uni-potsdam.de


 M  +7 -0      interfaces/ktexteditor/movingrange.h  
 M  +6 -2      kate/search/katesearchbar.cpp  
 M  +3 -0      kate/view/kateview.cpp  
 M  +2 -1      kate/view/kateviewhelpers.cpp  
 M  +5 -0      kate/view/kateviewinternal.cpp  


--- trunk/KDE/kdelibs/interfaces/ktexteditor/movingrange.h #1145805:1145806
@@ -211,6 +211,13 @@
      * Ranges with smaller Z-depth than others will win during rendering.
      * Default is 0.0.
      * 
+     * Defined depths for common kind of ranges use in editor components implenting this interface,
+     * smaller depths are more more in the foreground and will win during rendering:
+     * - Selection == -100000.0
+     * - Search == -10000.0
+     * - Bracket Highlighting == -1000.0
+     * - Folding Hover == -100.0
+     * 
      * \return current Z-depth of this range
      */
     virtual qreal zDepth () const = 0;
--- trunk/KDE/kdelibs/kate/search/katesearchbar.cpp #1145805:1145806
@@ -264,16 +264,20 @@
 void KateSearchBar::highlightMatch(const Range & range) {
     KTextEditor::MovingRange* const highlight = m_view->doc()->newMovingRange(range, Kate::TextRange::DoNotExpand);
     highlight->setView(m_view); // show only in this view
+    highlight->setAttributeOnlyForViews(true);
+    // use z depth defined in moving ranges interface
+    highlight->setZDepth (-10000.0);
     highlight->setAttribute(highlightMatchAttribute);
-    highlight->setAttributeOnlyForViews(true);
     m_hlRanges.append(highlight);
 }
 
 void KateSearchBar::highlightReplacement(const Range & range) {
     KTextEditor::MovingRange* const highlight = m_view->doc()->newMovingRange(range, Kate::TextRange::DoNotExpand);
     highlight->setView(m_view); // show only in this view
+    highlight->setAttributeOnlyForViews(true);
+    // use z depth defined in moving ranges interface
+    highlight->setZDepth (-10000.0);
     highlight->setAttribute(highlightReplacementAttribute);
-    highlight->setAttributeOnlyForViews(true);
     m_hlRanges.append(highlight);
 }
 
--- trunk/KDE/kdelibs/kate/view/kateview.cpp #1145805:1145806
@@ -140,6 +140,9 @@
   // selection if for this view only and will invalidate if becoming empty
   m_selection.setView (this);
 
+  // use z depth defined in moving ranges interface
+  m_selection.setZDepth (-100000.0);
+
   KateGlobal::self()->registerView( this );
 
   KTextEditor::ViewBarContainer *viewBarContainer=qobject_cast<KTextEditor::ViewBarContainer*>( KateGlobal::self()->container() );
--- trunk/KDE/kdelibs/kate/view/kateviewhelpers.cpp #1145805:1145806
@@ -1334,7 +1334,8 @@
     KTextEditor::Attribute::Ptr attr(new KTextEditor::Attribute());
     attr->setBackground(foldingColor(0, m_currentBlockLine, false));
     m_foldingRange->setView (m_view);
-    m_foldingRange->setZDepth (1000.0);
+    // use z depth defined in moving ranges interface
+    m_foldingRange->setZDepth (-100.0);
     m_foldingRange->setAttribute(attr);
   }
 }
--- trunk/KDE/kdelibs/kate/view/kateviewinternal.cpp #1145805:1145806
@@ -120,6 +120,11 @@
   m_bmStart->setAttributeOnlyForViews (true);
   m_bmEnd->setAttributeOnlyForViews (true);
 
+  // use z depth defined in moving ranges interface
+  m_bm->setZDepth (-1000.0);
+  m_bmStart->setZDepth (-1000.0);
+  m_bmEnd->setZDepth (-1000.0);
+
   // update mark attributes
   updateBracketMarkAttributes();
 




More information about the KDevelop-devel mailing list