Bug 118822 - outliner some interaction suggestions
Summary: outliner some interaction suggestions
Status: RESOLVED WORKSFORME
Alias: None
Product: calligrastage
Classification: Applications
Component: usability (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: T Zachmann
URL: https://community.kde.org/Calligra/Id...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-21 23:51 UTC by Thomas Zander
Modified: 2025-03-19 03:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander 2005-12-21 23:51:36 UTC
Version:           1.4 post (using KDE 3.5.0, compiled sources)
Compiler:          Target: x86_64-linux-gnu
OS:                Linux (x86_64) release 2.6.13.2

The entries in the Outline are tree based; under each slide is a list of all the objects on the slide.
When you have several objects on 1 slide, and click on those objects on the actual slide one by one, the ordering in the outliner jumps changes a lot.
Additionally; selecting something in the outliner selects the real object on the slide, but thats a one way selection. Deselecting or selecting other objects does not affect the outliner.

Suggestion1: make the sorting of the items per slide based on the position, top left first, bottom right last. This solves the problem of 'jumping' objects and makes the mental model easy for the user to grasp.
Suggestion2: update the outliner ordering only after a change in position or size (now it also updates on change of selection).
Suggestion3: update the outliner selection on change in selection of the active object.
Comment 1 T Zachmann 2005-12-24 08:18:26 UTC
SVN commit 491012 by zachmann:

o Don't change the order of the objects in the outline when objects are
  modified. The problem was that the order of the objects was updated
  when one object was selected to bring it to the front. Now only the
  list for displaying the objects is changed and not the list itself.
  
  So now the order of the objects is as intended the z-order of the
  objects. With this it will be possible in future to use the sidebar 
  to change the z-order of the objects.
o Added documentaion to the modified methods.  

CCBUG: 118822


 M  +27 -47    KPrCanvas.cpp  
 M  +25 -2     KPrCanvas.h  


--- trunk/koffice/kpresenter/KPrCanvas.cpp #491011:491012
@@ -98,6 +98,7 @@
 , buffer( size() )
 , m_gl( _view, _view->zoomHandler() )
 , m_paintGuides( false )
+, m_objectDisplayAbove( 0 )    
 {
     m_presMenu = 0;
     m_currentTextObjectView=0L;
@@ -136,7 +137,6 @@
         m_isMoving = false;
         m_isResizing = false;
         mouseSelectedObject = false;
-        selectedObjectPosition = -1;
         m_setPageTimer = true;
         m_drawLineInDrawMode = false;
         soundPlayer = 0;
@@ -623,7 +623,7 @@
     if ( page->masterPage() && page->displayObjectFromMasterPage() )
         drawObjectsEdit( painter, rect, page->masterPage()->objectList(), selectionMode, pageNum );
     //objects on current page
-    drawObjectsEdit( painter, rect, page->objectList(), selectionMode, pageNum );
+    drawObjectsEdit( painter, rect, displayObjectList(), selectionMode, pageNum );
 }
 
 
@@ -3352,24 +3352,12 @@
 
     drawBackground( &p, _pix.rect(), page, true );
 
-    //objects in current page
-    QPtrList<KPrObject> _list = page->objectList();
-
-    // check if object is selected, if so put it on the right place for the output
-    if( _list.count() > 1 && (int)_list.count() > selectedObjectPosition && selectedObjectPosition >= 0) {
-        _list.setAutoDelete( false );
-        KPrObject *kpobject = _list.last();
-        if ( kpobject->isSelected() ) {
-            _list.take( _list.count() - 1 );
-            _list.insert( selectedObjectPosition, kpobject );
-        }
-    }
-
     // draw objects on master slide
     if ( page->masterPage() && page->displayObjectFromMasterPage() )
         drawAllObjectsInPage( &p, page->masterPage()->objectList(), pgnum );
 
-    drawAllObjectsInPage( &p, _list, pgnum );
+    //objects in current page
+    drawAllObjectsInPage( &p, page->objectList(), pgnum );
 
     editMode = _editMode;
     p.end();
@@ -5020,47 +5008,37 @@
     }
 }
 
-void KPrCanvas::raiseObject( KPrObject *_kpobject )
+void KPrCanvas::raiseObject( KPrObject *object )
 {
-    if( objectList().count() <= 1 )
+    if ( objectList().count() <= 1 )
         return;
-    if ( selectedObjectPosition == -1 ) {
-        if ( m_activePage->numSelected() == 1 ) { // execute this if user selected is one object.
-            QPtrList<KPrObject> _list = objectList();
-            _list.setAutoDelete( false );
-
-            if ( _kpobject->isSelected() ) {
-                selectedObjectPosition = objectList().findRef( _kpobject );
-                _list.take( selectedObjectPosition );
-                _list.append( _kpobject );
-            }
-
-            m_activePage->setObjectList( _list );
+    
+    if ( m_objectDisplayAbove == 0 )
+    {
+        if ( m_activePage->numSelected() == 1 )
+        {
+            m_objectDisplayAbove = object;
         }
-        //tz not needed
-        else
-            selectedObjectPosition = -1;
     }
 }
 
 void KPrCanvas::lowerObject()
 {
-    if ( selectedObjectPosition != -1 )
-    {
-        if( objectList().count() <= 1 || (int)objectList().count() <= selectedObjectPosition )
-            return;
-        KPrObject *kpobject = objectList().last();
-        QPtrList<KPrObject> _list = objectList();
-        _list.setAutoDelete( false );
+    m_objectDisplayAbove = 0;
+}
 
-        if ( kpobject->isSelected() ) {
-            _list.take( _list.count() - 1 );
-            if ( objectList().findRef( kpobject ) != -1 )
-                _list.insert( selectedObjectPosition, kpobject );
-        }
-        m_activePage->setObjectList( _list );
-        selectedObjectPosition = -1;
+const QPtrList<KPrObject> KPrCanvas::displayObjectList() const
+{
+    QPtrList<KPrObject> list = objectList();
+    list.setAutoDelete( false );
+
+    if ( m_objectDisplayAbove && m_objectDisplayAbove->isSelected() ) 
+    {
+        int pos = objectList().findRef( m_objectDisplayAbove );
+        list.take( pos );
+        list.append( m_objectDisplayAbove );
     }
+    return list;
 }
 
 void KPrCanvas::playSound( const QString &soundFileName )
@@ -5249,6 +5227,8 @@
 {
     Q_ASSERT(active);
     //kdDebug(33001)<<"KPrCanvas::setActivePage( KPrPage* active) :"<<active<<endl;
+    // reset the m_objectDisplayAbove so that it is not display wrong on the other page
+    m_objectDisplayAbove = 0;
     m_activePage = active;
 }
 
--- trunk/koffice/kpresenter/KPrCanvas.h #491011:491012
@@ -611,9 +611,29 @@
     /// create KPrResizeCmd
     void finishResizeObject( const QString &name, bool layout = true );
 
-    void raiseObject( KPrObject *_kpobject );
+    /**
+     * @brief Display object above the other objects in editiong mode
+     *
+     * This is used to bring a single slected object to front, so it is easier 
+     * to modify.
+     *
+     * @param object which should be displayed above the other objects
+     */
+    void raiseObject( KPrObject *object );
+    /**
+     * @brief Don't display an object above the others
+     */
     void lowerObject();
-    int selectedObjectPosition;
+    /**
+     * @brief Get the list of objects in the order they should be displayed.
+     *
+     * This takes into acount the object set in raiseObject so that it is 
+     * the last one in the list returned (the one that is displayed above all
+     * the others).
+     *
+     * @return List of objects
+     */
+    const QPtrList<KPrObject> displayObjectList() const; 
 
     /**
      * This is used in automatic presentation mode.
@@ -863,6 +883,9 @@
     /// true if we are in guide move state, false otherwise
     bool m_paintGuides;
 
+    /// object which is selected and should be shown above all the other objects
+    KPrObject * m_objectDisplayAbove;
+
     /// Previously spoken text object.
     KPrTextObject *m_prevSpokenTO;
 };
Comment 2 T I Z E N 2025-02-17 19:32:35 UTC
If the origin Members still active on this or have an Ticket, MR or PR (as in Invent or on the Kanban), can you insert it to the Bug Report?
Thank you for the bug report. Unfortunately we were not able to get to it yet. Can we ask you to please check if this is still an issue with either Plasma 5.27 (the current LTS version) or Plasma 6.3 (the latest released version).

Regards,

[Tizen](https://invent.kde.org/tizen)
Comment 3 Bug Janitor Service 2025-03-04 03:46:52 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2025-03-19 03:47:17 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.