Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_row.c ewl_scrollpane.c ewl_seeker.c
Log Message:
Fix for row layout bug. Prevent some corner cases for calculating draggable
bar geometry in the seeker/scrollbars.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewl_row.c 9 Oct 2003 07:32:56 -0000 1.16
+++ ewl_row.c 11 Nov 2003 18:00:08 -0000 1.17
@@ -134,7 +134,6 @@
x = CURRENT_X(w);
ewd_list_goto_first(c->children);
- ewd_list_goto_first(EWL_CONTAINER(row)->children);
/*
* This should be the common case, a row bounded by a set of fields,
@@ -143,8 +142,13 @@
if (row->header) {
int i = 0;
int width;
+ Ewl_Container *hdr;
+
+ hdr = EWL_CONTAINER(row->header);
+ ewd_list_goto_first(EWL_CONTAINER(hdr)->children);
+
while ((child = ewd_list_next(c->children))) {
- align = ewd_list_next(EWL_CONTAINER(row)->children);
+ align = ewd_list_next(EWL_CONTAINER(hdr)->children);
if (align)
width = CURRENT_X(align) + CURRENT_W(align) - x;
else
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_scrollpane.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ewl_scrollpane.c 25 Oct 2003 05:55:47 -0000 1.25
+++ ewl_scrollpane.c 11 Nov 2003 18:00:08 -0000 1.26
@@ -182,6 +182,7 @@
int vs_width = 0;
int hs_height = 0;
int content_w, content_h;
+ double step;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
@@ -219,24 +220,36 @@
* minimum size.
*/
b_width = ewl_object_get_preferred_w(EWL_OBJECT(s->box));
- if (b_width < 0)
- b_width = 0;
b_height = ewl_object_get_preferred_h(EWL_OBJECT(s->box));
- if (b_height < 0)
- b_height = 0;
/*
* Adjust the scrollbar internal stepping to match the contents.
*/
- ewl_scrollbar_set_step(EWL_SCROLLBAR(s->hscrollbar),
- (double)content_w / (double)b_width);
- ewl_scrollbar_set_step(EWL_SCROLLBAR(s->vscrollbar),
- (double)content_h / (double)b_height);
-
- b_width = (int)(ewl_scrollbar_get_value(EWL_SCROLLBAR(s->hscrollbar)) *
- (double)(b_width - content_w));
- b_height= (int)(ewl_scrollbar_get_value(EWL_SCROLLBAR(s->vscrollbar)) *
- (double)(b_height - content_h));
+ if (content_w < b_width) {
+ step = (double)content_w / (double)b_width;
+ b_width = (int)ewl_scrollbar_get_value(EWL_SCROLLBAR(
+ s->hscrollbar)) *
+ (double)(b_width - content_w);
+ }
+ else {
+ step = 1.0;
+ b_width = 0;
+ }
+
+ ewl_scrollbar_set_step(EWL_SCROLLBAR(s->hscrollbar), step);
+
+ if (content_h < b_height) {
+ step = (double)content_h / (double)b_height;
+ b_height= (int)(ewl_scrollbar_get_value(EWL_SCROLLBAR(
+ s->vscrollbar)) *
+ (double)(b_height - content_h));
+ }
+ else {
+ step = 1.0;
+ b_height = 0;
+ }
+
+ ewl_scrollbar_set_step(EWL_SCROLLBAR(s->vscrollbar), step);
/*
* Now move the box into position. For the scrollpane to work we move
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_seeker.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_seeker.c 10 Nov 2003 22:55:27 -0000 1.46
+++ ewl_seeker.c 11 Nov 2003 18:00:09 -0000 1.47
@@ -456,6 +456,9 @@
if (s->dragstart < 1)
DRETURN(DLEVEL_STABLE);
+ if (s->step == s->range)
+ DRETURN(DLEVEL_STABLE);
+
ev = ev_data;
mx = ev->x;
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs