Bug 118676 - Rectangle object can be made to vanish
Summary: Rectangle object can be made to vanish
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 01:12 UTC by Andrew Walker
Modified: 2005-12-20 03:04 UTC (History)
0 users

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 Andrew Walker 2005-12-20 01:12:04 UTC
Version:           HEAD (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
Selecting property combinations for the rectangle can render it invisible

STEPS TO REPRODUCE:
Create a rectangle object
Entry layout mode and double click on the object to launch the Edit Box dialog
Set the Border width to 0
Check the Transparent fill property
Hit OK

EXPECTED RESULTS:
This property combination is not permitted or the user is warned

RESULTS:
The property combination is permitted and the rectangle vanishes (leaving only its focus rectangles). There is no way for the user to select the rectangle again.
Comment 1 George Staikos 2005-12-20 01:52:29 UTC
   Maybe we shouldn't fall through transparent rectangles for mouse hover and 
click.
Comment 2 George Staikos 2005-12-20 03:04:02 UTC
SVN commit 489892 by staikos:

Boxes are always movable in their geometry rect.  Seems to make sense I think,
but up for comment.  For now it fixes the usability issue.
BUG: 118676


 M  +2 -1      kstviewbox.cpp  
 M  +11 -1     kstviewobject.cpp  
 M  +2 -0      kstviewobject.h  


--- trunk/extragear/graphics/kst/kst/kstviewbox.cpp #489891:489892
@@ -34,6 +34,7 @@
   _xRound = 0;
   _yRound = 0;
   _cornerStyle = Qt::MiterJoin;
+  _fallThroughTransparency = false;
   setTransparent(true);
   _transparentFill = false;
   setFollowsFlow(true);
@@ -57,9 +58,9 @@
   // these always have these values
   _type = "Box";
   _layoutActions |= Delete | Raise | Lower | RaiseToTop | LowerToBottom | Rename | MoveTo | Copy | CopyTo;
+  _fallThroughTransparency = false;
   setTransparent(true);
   setFollowsFlow(true);
-
 }
 
 
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #489891:489892
@@ -71,6 +71,7 @@
   _transparent = false;
   _followsFlow = false;
   _dialogLock = false;
+  _fallThroughTransparency = true;
   setMinimumSize(DEFAULT_MINIMUM_SIZE);
 }
 
@@ -85,6 +86,7 @@
   _transparent = false;
   _followsFlow = false;
   _dialogLock = false;
+  _fallThroughTransparency = true;
   setMinimumSize(DEFAULT_MINIMUM_SIZE);
   load(e);
 }
@@ -105,6 +107,7 @@
   _container = true;
   _dialogLock = false;
   _selected = false;
+  _fallThroughTransparency = true;
   _geom = viewObject._geom;
   _transparent = viewObject._transparent;
   _followsFlow = viewObject._followsFlow;
@@ -836,8 +839,10 @@
       }
       if (!obj) {
         if ((*i)->transparent()) {
-          if ((*i)->clipRegion().contains(pos)) {
+          if (!(*i)->fallThroughTransparency() && (*i)->geometry().contains(pos)) {
             obj = *i;
+          } else if ((*i)->clipRegion().contains(pos)) {
+            obj = *i;
           } else if (borderForTransparent && (*i)->geometry().contains(pos)) {
             const QRect g((*i)->geometry());
             if ((pos.x() >= g.left() && pos.x() <= g.left() + KST_RESIZE_BORDER_W) ||
@@ -1740,5 +1745,10 @@
   return _dialogLock;
 }
 
+
+bool KstViewObject::fallThroughTransparency() const {
+  return _fallThroughTransparency;
+}
+
 #include "kstviewobject.moc"
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/kstviewobject.h #489891:489892
@@ -111,6 +111,7 @@
     KstViewObjectList& children();
 
     bool objectDirty() const; // true if this object or a child is dirty
+    bool fallThroughTransparency() const;
 
     virtual QWidget *configWidget();
 
@@ -291,6 +292,7 @@
     bool _followsFlow : 1;
     bool _dialogLock : 1;
     bool _container : 1;
+    bool _fallThroughTransparency : 1;
     int _columns : 6; // "64 columns ought to be enough for anyone"
     QGuardedPtr<KstViewObject> _topObjectForMenu;
     QGuardedPtr<KstViewObject> _parent; // danger!!