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

List:       kde-bugs-dist
Subject:    [Bug 41693] some widgets are not showed correctly on bidi enabled
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2004-05-31 19:40:43
Message-ID: 20040531194043.28268.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=41693      




------- Additional Comments From reinhold kainhofer com  2004-05-31 21:40 -------
CVS commit by kainhofe: 

Correctly place the agenda items in RTL languages (and assign the correct width to \
them, so far, we tried to assign a negative width with was interpreted as zero).

Bug 41693 also talks about moving items in the agenda view, which is still not \
solved, so I'm leaving that report open, but the most grave part of the bug should be \
fixed.

CCMAIL: 41693 bugs kde org


  M +24 -8     koagenda.cpp   1.119


--- kdepim/korganizer/koagenda.cpp  #1.118:1.119
 @ -1003,5 +1003,5  @ void KOAgenda::placeAgendaItem( KOAgenda
 //            << " subCellWidth: " << subCellWidth << endl;
 
-  // left upper corner, no subcells yet
+  // "left" upper corner, no subcells yet, RTL layouts have right/left switched, \
widths are negative then  QPoint pt = gridToContents( QPoint( item->cellXLeft(), \
item->cellYTop() ) );  // right lower corner
 @ -1013,12 +1013,28  @ void KOAgenda::placeAgendaItem( KOAgenda
   // we need to add 0.01 to make sure we don't loose one pixed due to
   // numerics (i.e. if it would be x.9998, we want the integer, not rounded down.
+  double delta=0.01;
+  if (subCellWidth<0) delta=-delta;
+  int height, width, xpos, ypos;
   if (mAllDayMode) {
-    item->resize( pt1.x()-pt.x(), int( subCellPos + subCellWidth + 0.01 ) - int( \
                subCellPos ) );
-    pt.setY( pt.y() + int( subCellPos ) );
+    width = pt1.x()-pt.x();
+    height = int( subCellPos + subCellWidth + delta ) - int( subCellPos );
+    xpos = pt.x();
+    ypos = pt.y() + int( subCellPos );
   } else {
-    item->resize( int( subCellPos + subCellWidth + 0.01 ) - int( subCellPos ), \
                pt1.y()-pt.y() );
-    pt.setX( pt.x() + int( subCellPos ) );
+    width = int( subCellPos + subCellWidth + delta ) - int( subCellPos );
+    height = pt1.y()-pt.y();
+    xpos = pt.x() + int( subCellPos );
+    ypos = pt.y();
   }
-  moveChild( item, pt.x(), pt.y() );
+  if (width<0) { // RTL language/layout
+    xpos += width;
+    width = -width;
+  }
+  if (height<0) { // BTT (bottom-to-top) layout ?!?
+    ypos += height;
+    height = -height;
+  }
+  item->resize( width, height );
+  moveChild( item, xpos, ypos );
 }


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

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