[Kde-accessibility] Re: kdeaccessibility module as official part of KDE

Luciano Montanaro mikelima at virgilio.it
Sun Aug 31 15:54:34 CEST 2003


On Sunday 31 August 2003 13:22, Gunnar Schmi Dt wrote:

> Indeed that is what we need. Just one small (optical) addition: In the
> configuration dialog we have the labels "small", "medium" and "wide". The
> problem is that "medium" is not really a window decoration which you would
> call medium sized. Is it possible to add a fourth label "extra wide"?
>

I experimented with the labels a bit. I think the best option would be to
simply drom the "medium" label. For people with low vision, the font for the
panel would have to be large, so if we add too much text, it would exceed the
screen size.

> > [...]
> >
> > > > For the title bar button of the CDE style, they could be drawn black
> > > > on white the way the Irix window manager did - it would improve the
> > > > CDE look also, in my opinion. If nobody else volunteers, I'd like to
> > > > try to make these changes to the CDE client.
> > >
> > > Possibly with a check box for the style of the title bar buttons? Good
> > > idea, I vote for doing it.
> >
> > Yes this was my idea.
> > Now that I see the 30 pixel border, maybe the bevel size should be
> > increased too, for large frame widths.
> > Whose needs is this feature designed for? People with low vision or
> > people who cannot precisely move the pointer on the screen?
> > [...]
>
> We are designing for both of them. Regarding the bevel size I would suggest
> to modify its size proportional to the width of the decoration.
>

I'll experiment with that later. Meanwhile, here is the updated patch.
This one centers or scales the button icons to match the decoration width.
I can commit these changes to CVS if they are okay for everybody.

Luciano

? cdeclient.patch
? cdeclient2.patch
Index: cdeclient.cpp
===================================================================
RCS file: /home/kde/kdeartwork/kwin-styles/cde/cdeclient.cpp,v
retrieving revision 1.13
diff -p -u -r1.13 cdeclient.cpp
--- cdeclient.cpp	26 Jul 2003 21:38:49 -0000	1.13
+++ cdeclient.cpp	31 Aug 2003 12:54:32 -0000
@@ -34,26 +34,45 @@ static int s_frameWidth = 5;
 static bool titlebarButtonMode = true;
 static bool coloredFrame = true;
 static Qt::AlignmentFlags textAlignment = Qt::AlignHCenter;
-static const int s_buttonSize = 19;
+static int s_buttonSize = 19;
+
+// Parameters needed to draw the widgets (offsets from the border)
+static int s_o1 = 4;
+static int s_o2 = 7;
+static int s_w1 = 11;
+static int s_w2 = 5;
 
 // These are the line segments for the X on the close button
-static const QCOORD closeLLines[] =
+
+static const int NUM_CLOSEL_COORDS = 2 * 14;
+static const QCOORD closeLLinesTemplate[NUM_CLOSEL_COORDS] =
     { 14,3, 12,3,  12,3, 9,6,  5,3, 3,3,  3,3, 3,5,
       3,5, 6,8, 6,9, 3,12,  3,12, 3,14 };
 
-static const QCOORD closeDLines[] =
+static const int NUM_CLOSED_COORDS = 2 * 18;
+static const QCOORD closeDLinesTemplate[NUM_CLOSED_COORDS] =
     { 6,4, 8,6,  14,4, 14,5,  14,5, 11,8,  11,9, 14,12,  14,12, 14,14,
       14,14, 12,14,  12,14, 9,11,  8,11, 5,14,  5,14, 4,14 };
 
+static QCOORD closeLLines[NUM_CLOSEL_COORDS];
+
+static QCOORD closeDLines[NUM_CLOSED_COORDS];
+      
 // These are the line segments for the ? on the help button
-static const QCOORD helpLLines[] =
+static const int NUM_HELPL_COORDS = 2 * 16;
+static const QCOORD helpLLinesTemplate[NUM_HELPL_COORDS] =
     { 4,6, 4,5,  4,5, 6,3,  6,3, 9,3,  10,3, 11,4,
       9,7, 7,9,  7,9, 7,10,  7,14, 7,13,  8,12, 9,12  };
 
-static const QCOORD helpDLines[] =
+static const int NUM_HELPD_COORDS = 2 * 14;
+static const QCOORD helpDLinesTemplate[NUM_HELPD_COORDS] =
     {  5,7, 8,6,  12,5, 12,8,  12,8, 10,10,  10,10, 10,11,
        10,11, 8,11,  10,14, 10,13,  9,15, 8,15 };
 
+static QCOORD helpLLines[NUM_HELPL_COORDS];
+
+static QCOORD helpDLines[NUM_HELPD_COORDS];
+
 
 // This question mark is taller than the one above and
 // is positioned one pixel higher on the button
@@ -133,7 +152,7 @@ void CdeButton::drawButton( QPainter* p 
     switch ( m_btnType )
     {
         case (BtnMenu):
-            qDrawShadePanel( p, 4, 7, 11, 4, colorGroup );
+            qDrawShadePanel( p, s_o1, s_o2, s_w1, s_w2, colorGroup );
 	break;
 	case (BtnHelp):
 	    p->setPen( colorGroup.light() );
@@ -142,10 +161,11 @@ void CdeButton::drawButton( QPainter* p 
 	    p->drawLineSegments( QPointArray(14, helpDLines) );
 	break;
 	case (BtnIconify):
-	    qDrawShadePanel( p, 7, 7, 5, 5, colorGroup );
+	    qDrawShadePanel( p, s_o2, s_o2, s_w2, s_w2, colorGroup );
 	break;
 	case (BtnMax):
-	    qDrawShadePanel( p, 4, 4, 11, 11, colorGroup, m_parent->isMaximized() );
+	    qDrawShadePanel( p, s_o1, s_o1, s_w1, s_w1, colorGroup, 
+		    m_parent->isMaximized() );
 	break;
 	case (BtnClose):
 	    p->setPen( colorGroup.light() );
@@ -609,8 +629,37 @@ static void readConfig()
 
     // Do not allow malicious users or corrupt config files to
     // go past the domain of the valid border sizes.
+    
+    // Size limit increased for accessability. LM
     if (s_frameWidth < 0)  s_frameWidth = 0;
-    if (s_frameWidth > 10) s_frameWidth = 10;
+    if (s_frameWidth > 30) s_frameWidth = 30;
+    
+    // Force button size to be in a reasonable range.
+    // If the frame width is large, the button size must be large too.
+    s_buttonSize = QFontMetrics(options->font( true )).height() + 2;
+    if (s_buttonSize < 19) s_buttonSize = 19;
+    if (s_buttonSize < s_frameWidth) s_buttonSize = s_frameWidth;
+
+    // Calculate widths and offsets for the button icons
+    s_o1 = s_buttonSize * 4 / 19;
+    s_o2 = s_buttonSize * 7 / 19;
+    s_w1 = s_buttonSize - 2 * s_o1;
+    s_w2 = s_buttonSize - 2 * s_o2;
+
+    // Copy and center the button icons
+    int offset = (s_buttonSize - 19) / 2;
+    for (int i = 0; i < NUM_CLOSEL_COORDS; i++) {
+	closeLLines[i] = closeLLinesTemplate[i] + offset;
+    }
+    for (int i = 0; i < NUM_CLOSED_COORDS; i++) {
+	closeDLines[i] = closeDLinesTemplate[i] + offset;
+    }
+    for (int i = 0; i < NUM_HELPL_COORDS; i++) {
+	helpLLines[i] = helpLLinesTemplate[i] + offset;
+    }
+    for (int i = 0; i < NUM_HELPD_COORDS; i++) {
+	helpDLines[i] = helpDLinesTemplate[i] + offset;
+    }
 }
 
 }
Index: config/config.cpp
===================================================================
RCS file: /home/kde/kdeartwork/kwin-styles/cde/config/config.cpp,v
retrieving revision 1.6
diff -p -u -r1.6 config.cpp
--- config/config.cpp	30 Jun 2003 08:16:28 -0000	1.6
+++ config/config.cpp	31 Aug 2003 12:54:33 -0000
@@ -32,7 +32,7 @@ CdeConfig::CdeConfig( KConfig* conf, QWi
 	groupBox = new QVBox( parent );
 	
 	gbSlider = new QGroupBox( 1, Qt::Horizontal, i18n("Frame &Width"), groupBox 
);
-	widthSlider = new QSlider( 0, 10, 1, 5, QSlider::Horizontal, gbSlider ); 
+	widthSlider = new QSlider( 0, 30, 1, 5, QSlider::Horizontal, gbSlider ); 
 	widthSlider->setTickmarks( QSlider::Below );
 	QWhatsThis::add( widthSlider, i18n("By moving this slider back and forth, 
you can adjust the width of the "
 					    "window frame to a value of your liking.\n"
@@ -45,8 +45,8 @@ CdeConfig::CdeConfig( KConfig* conf, QWi
 	bool rtl = kapp->reverseLayout();
 	QLabel *label1 = new QLabel( i18n("Thin"), hbox );
 	label1->setAlignment( rtl ? AlignRight : AlignLeft );
-	QLabel *label2 = new QLabel( i18n("Medium"), hbox );
-	label2->setAlignment( AlignCenter );
+	//QLabel *label2 = new QLabel( i18n("Medium"), hbox );
+	//label2->setAlignment( AlignCenter );
 	QLabel *label3 = new QLabel( i18n("Wide"), hbox );
 	label3->setAlignment( rtl ? AlignLeft : AlignRight );
 	



More information about the kde-accessibility mailing list