[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Minimum size of embedded documents
From:       Philipp =?iso-8859-1?q?M=FCller?= <philipp.mueller () gmx ! de>
Date:       2002-11-18 21:06:43
[Download RAW message or body]

Am Montag, 18. November 2002 10:56 schrieb David Faure:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sunday 17 November 2002 18:56, Philipp Müller wrote:
> > To make it easy to select, a size of 10 (10 pixels at 72dpi with 100%
> > zoom) should be fine, but it may limit small embedded pictures. So I
> > would suggest 4 as the minimum.
>
> Sounds good.

Patch attached (this is against BRANCH). I've choosen now 3 instead of 4. This 
is I think really the lowest size one want to have (a small triangle). Don't 
think one would like to have an embedded 2x2 pixel picture ;-) and the object 
can still be selected.

Of course, one can still zoom, so the area to select would get bigger.


> > So what do you think, or is it only a problem of KSpread here?
>
> No, this indeed affects all apps.

KWord partly: KWord has a solid frame border around each object, so the user 
sees and can mark the border (here it is 3 + 2 * 1 already).

KPresenter not. KP has the border as well as the possibility to start with the 
mouse a frame, which selects all embedded objects/frames, regardless of the 
size of the object.

Dunno about Kivio.

> What remains to be seen is whether this can be fixed in kofficecore
> (i.e. whether preventing a KoChild from being resized too small will
> correctly redraw things, and give correct size information to the app etc.)
> Sounds feasible though.

See patch. Maybe the #define should be more central and/or have a more 
descriptive name.

KSpread needs an additional fix. New embedded objects are started within each 
app, only resize is handled in kofficecore. So there maybe an issue with new 
objects in KW and KP as well.

Philipp


["kofficecore.diff" (text/x-diff)]

Index: handler.cpp
===================================================================
RCS file: /home/kde/koffice/lib/kofficecore/handler.cpp,v
retrieving revision 1.13
diff -u -r1.13 handler.cpp
--- handler.cpp	2001/10/11 15:56:20	1.13
+++ handler.cpp	2002/11/18 20:56:19
@@ -23,6 +23,8 @@
 #include <kcursor.h>
 #include <kdebug.h>
 
+#define KO_MIN_RECTSIZE 3
+
 EventHandler::EventHandler( QObject* target )
 {
     m_target = target;
@@ -126,8 +128,10 @@
                 x = QMIN( d->m_geometryStart.width() - 1, x );
                 y = QMIN( d->m_geometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, \
                d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width() - x, \
d->m_geometryStart.height() - y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x() + x, +                                                \
d->m_geometryStart.y() + y, +                                                QMAX( \
d->m_geometryStart.width() - x, KO_MIN_RECTSIZE ), +                                  \
QMAX( d->m_geometryStart.height() - y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
@@ -135,8 +139,10 @@
             {
                 y = QMIN( d->m_geometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), \
                d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width(), \
d->m_geometryStart.height() - y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x(), +                                                \
d->m_geometryStart.y() + y, +                                                \
d->m_geometryStart.width(), +                                                QMAX( \
d->m_geometryStart.height() - y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
@@ -145,8 +151,10 @@
                 x = QMAX( -d->m_geometryStart.width() + 1, x );
                 y = QMIN( d->m_geometryStart.height() - 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), \
                d->m_geometryStart.y() + y,
-                                             d->m_geometryStart.width() + x, \
d->m_geometryStart.height() - y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x(), +                                                \
d->m_geometryStart.y() + y, +                                                QMAX( \
d->m_geometryStart.width() + x, KO_MIN_RECTSIZE ), +                                  \
QMAX( d->m_geometryStart.height() - y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
@@ -154,8 +162,10 @@
             {
                 x = QMIN( d->m_geometryStart.width() - 1, x );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, \
                d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() - x, \
d->m_geometryStart.height() ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x() + x, +                                                \
d->m_geometryStart.y(), +                                                QMAX( \
d->m_geometryStart.width() - x, KO_MIN_RECTSIZE ), +                                  \
d->m_geometryStart.height() ) );  repaint(rgn);
             }
             break;
@@ -163,8 +173,10 @@
             {
                 x = QMAX( -d->m_geometryStart.width() + 1, x );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), \
                d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() + x, \
d->m_geometryStart.height() ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x(), +                                                \
d->m_geometryStart.y(), +                                                QMAX( \
d->m_geometryStart.width() + x, KO_MIN_RECTSIZE ), +                                  \
d->m_geometryStart.height() ) );  repaint(rgn);
             }
             break;
@@ -173,8 +185,10 @@
                 x = QMIN( d->m_geometryStart.width() - 1, x );
                 y = QMAX( -d->m_geometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, \
                d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() - x, \
d->m_geometryStart.height() + y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x() + x, +                                                \
d->m_geometryStart.y(), +                                                QMAX( \
d->m_geometryStart.width() - x, KO_MIN_RECTSIZE ), +                                  \
QMAX( d->m_geometryStart.height() + y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
@@ -182,8 +196,10 @@
             {
                 y = QMAX( -d->m_geometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), \
                d->m_geometryStart.y(),
-                                             d->m_geometryStart.width(), \
d->m_geometryStart.height() + y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x(), +                                                \
d->m_geometryStart.y(), +                                                \
d->m_geometryStart.width(), +                                                QMAX( \
d->m_geometryStart.height() + y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
@@ -192,8 +208,10 @@
                 x = QMAX( -d->m_geometryStart.width() + 1, x );
                 y = QMAX( -d->m_geometryStart.height() + 1, y );
 
-                d->m_child->setGeometry( QRect( d->m_geometryStart.x(), \
                d->m_geometryStart.y(),
-                                             d->m_geometryStart.width() + x, \
d->m_geometryStart.height() + y ) ); +                d->m_child->setGeometry( QRect( \
d->m_geometryStart.x(), +                                                \
d->m_geometryStart.y(), +                                                QMAX( \
d->m_geometryStart.width() + x, KO_MIN_RECTSIZE ), +                                  \
QMAX( d->m_geometryStart.height() + y, KO_MIN_RECTSIZE ) ) );  repaint(rgn);
             }
             break;
Index: koFrame.cc
===================================================================
RCS file: /home/kde/koffice/lib/kofficecore/koFrame.cc,v
retrieving revision 1.20
diff -u -r1.20 koFrame.cc
--- koFrame.cc	2001/07/10 23:14:32	1.20
+++ koFrame.cc	2002/11/18 20:56:20
@@ -26,6 +26,7 @@
 #include <kdebug.h>
 
 #define QMAX32767(a,b) QMAX(QMAX(32767,a),b)
+#define KO_MIN_RECTSIZE 3
 
 class KoFramePrivate
 {
@@ -84,8 +85,8 @@
     // (David)
     setMaximumSize( QMAX32767( d->m_view->maximumWidth() + 2 * border(), \
                d->m_view->maximumWidth() ),
 		    QMAX32767( d->m_view->maximumHeight() + 2 * border(), \
                d->m_view->maximumHeight() ) );
-    setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder(),
-		    d->m_view->minimumHeight() + topBorder() + bottomBorder() );
+    setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder() + \
KO_MIN_RECTSIZE, +		    d->m_view->minimumHeight() + topBorder() + bottomBorder() + \
KO_MIN_RECTSIZE );  
   }
 
@@ -115,8 +116,8 @@
       */
       setMaximumSize( QMAX32767( d->m_view->maximumWidth() + 2 * border(), \
                d->m_view->maximumWidth() ),
 		      QMAX32767( d->m_view->maximumHeight() + 2 * border(), \
                d->m_view->maximumHeight() ) );
-      setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder(),
-		      d->m_view->minimumHeight() + topBorder() + bottomBorder() );
+      setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder() + \
KO_MIN_RECTSIZE, +		      d->m_view->minimumHeight() + topBorder() + bottomBorder() + \
KO_MIN_RECTSIZE );  }
 
   if ( d->m_state == Inactive )


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic