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

List:       kde-pim
Subject:    [Kde-pim] Akregator accessibility fix for 3.5.5 with additional
From:       Frank Osterfeld <frank.osterfeld () gmx ! de>
Date:       2006-08-25 15:30:01
Message-ID: 200608251730.04555.frank.osterfeld () gmx ! de
[Download RAW message or body]

Hi,

I want to add the attached accessibility fix to the 3.5.5 branch.
It makes the colors in the article list configurable - which are currently 
hardcoded to blue and red. That is a no-no accessiblity-wise and constrains 
the use of Akregator for color-blind people [1]. To me, that's reason enough 
to add the configuration options for 3.5.5. 

The patch is in trunk. It isn't extensively tested yet, but the changes aren't 
complex either. 

Four new i18n'd strings are added ("Article List Colors", "Use custom 
colors", "Unread articles", "New articles").

Frank

[1] http://bugs.kde.org/show_bug.cgi?id=116079

["akregator-configurable-colors.diff" (text/x-diff)]

Index: akregator.kcfg
===================================================================
--- akregator.kcfg	(revision 573936)
+++ akregator.kcfg	(working copy)
@@ -40,6 +40,16 @@
    <entry key="Fixed Font" type="String" />
    <entry key="Serif Font" type="String" />
    <entry key="Sans Serif Font" type="String" />
+   <entry key="UseCustomColors" type="Bool">
+        <default>false</default>
+   </entry>
+    <entry key="ColorUnreadArticles" type="Color">
+        <default>#0000FF</default>
+    </entry>
+    <entry key="ColorNewArticles" type="Color">
+        <default>#FF0000</default>
+    </entry>
+        
  </group>
  <group name="HTML Settings" >
   <entry key="Fonts" type="StringList" />
Index: articlelistview.cpp
===================================================================
--- articlelistview.cpp	(revision 573936)
+++ articlelistview.cpp	(working copy)
@@ -181,15 +181,20 @@
         QColorGroup cg2(cg);
     
         if (article().status() == Article::Unread)
-            cg2.setColor(QColorGroup::Text, Qt::blue);
+            cg2.setColor(QColorGroup::Text, Settings::useCustomColors() ? \
Settings::colorUnreadArticles() : Qt::blue);  else // New
-            cg2.setColor(QColorGroup::Text, Qt::red);
+            cg2.setColor(QColorGroup::Text, Settings::useCustomColors() ? \
Settings::colorNewArticles() : Qt::red);  
         KListViewItem::paintCell( p, cg2, column, width, align );
     }
 
 }
 
+void ArticleListView::slotPaletteOrFontChanged()
+{
+    triggerUpdate();
+}
+
 void ArticleListView::ArticleItem::updateItem(const Article& article)
 {
     m_article = article;
Index: articlelistview.h
===================================================================
--- articlelistview.h	(revision 573936)
+++ articlelistview.h	(working copy)
@@ -80,6 +80,8 @@
             /** selects next unread article in list view, first unread article if no \
article was selected */  void slotNextUnreadArticle();
 
+            void slotPaletteOrFontChanged();
+            
         signals:
             void signalArticleChosen(const Article& article);
             void signalDoubleClicked(const Article&, const QPoint&, int);
Index: settings_appearance.ui
===================================================================
--- settings_appearance.ui	(revision 573936)
+++ settings_appearance.ui	(working copy)
@@ -10,20 +10,20 @@
             <x>0</x>
             <y>0</y>
             <width>418</width>
-            <height>377</height>
+            <height>566</height>
         </rect>
     </property>
     <property name="caption">
         <string>General</string>
     </property>
-    <vbox>
+    <grid>
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
         <property name="margin">
             <number>0</number>
         </property>
-        <widget class="QGroupBox">
+        <widget class="QGroupBox" row="1" column="0">
             <property name="name">
                 <cstring>groupBox3</cstring>
             </property>
@@ -114,8 +114,25 @@
                 </widget>
             </grid>
         </widget>
-        <widget class="QGroupBox">
+        <spacer row="4" column="0">
             <property name="name">
+                <cstring>spacer1</cstring>
+            </property>
+            <property name="orientation">
+                <enum>Vertical</enum>
+            </property>
+            <property name="sizeType">
+                <enum>Expanding</enum>
+            </property>
+            <property name="sizeHint">
+                <size>
+                    <width>20</width>
+                    <height>41</height>
+                </size>
+            </property>
+        </spacer>
+        <widget class="QGroupBox" row="2" column="0">
+            <property name="name">
                 <cstring>FontsGroupBox</cstring>
             </property>
             <property name="title">
@@ -179,7 +196,7 @@
                 </widget>
             </grid>
         </widget>
-        <widget class="QCheckBox">
+        <widget class="QCheckBox" row="3" column="0">
             <property name="name">
                 <cstring>kcfg_UnderlineLinks</cstring>
             </property>
@@ -187,24 +204,99 @@
                 <string>&amp;Underline links</string>
             </property>
         </widget>
-        <spacer>
+        <widget class="QGroupBox" row="0" column="0">
             <property name="name">
-                <cstring>spacer1</cstring>
+                <cstring>groupBox3_2</cstring>
             </property>
-            <property name="orientation">
-                <enum>Vertical</enum>
+            <property name="title">
+                <string>Article List Colors</string>
             </property>
-            <property name="sizeType">
-                <enum>Expanding</enum>
-            </property>
-            <property name="sizeHint">
-                <size>
-                    <width>20</width>
-                    <height>41</height>
-                </size>
-            </property>
-        </spacer>
-    </vbox>
+            <grid>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QCheckBox" row="0" column="0" rowspan="1" \
colspan="2"> +                    <property name="name">
+                        <cstring>kcfg_UseCustomColors</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Use custom colors</string>
+                    </property>
+                </widget>
+                <widget class="QLayoutWidget" row="1" column="0">
+                    <property name="name">
+                        <cstring>layout1</cstring>
+                    </property>
+                    <grid>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <widget class="QLabel" row="0" column="0">
+                            <property name="name">
+                                <cstring>lbl_unreadArticles</cstring>
+                            </property>
+                            <property name="enabled">
+                                <bool>false</bool>
+                            </property>
+                            <property name="text">
+                                <string>Unread articles</string>
+                            </property>
+                        </widget>
+                        <widget class="KColorButton" row="1" column="1">
+                            <property name="name">
+                                <cstring>kcfg_ColorNewArticles</cstring>
+                            </property>
+                            <property name="enabled">
+                                <bool>false</bool>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <widget class="KColorButton" row="0" column="1">
+                            <property name="name">
+                                <cstring>kcfg_ColorUnreadArticles</cstring>
+                            </property>
+                            <property name="enabled">
+                                <bool>false</bool>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="1" column="0">
+                            <property name="name">
+                                <cstring>lbl_newArticles</cstring>
+                            </property>
+                            <property name="enabled">
+                                <bool>false</bool>
+                            </property>
+                            <property name="text">
+                                <string>New articles</string>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+                <spacer row="1" column="1">
+                    <property name="name">
+                        <cstring>spacer2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>110</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+            </grid>
+        </widget>
+    </grid>
 </widget>
 <customwidgets>
 </customwidgets>
@@ -233,18 +325,38 @@
         <receiver>kcfg_MinimumFontSize</receiver>
         <slot>setValue(int)</slot>
     </connection>
+    <connection>
+        <sender>kcfg_UseCustomColors</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>kcfg_ColorUnreadArticles</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
+    <connection>
+        <sender>kcfg_UseCustomColors</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>kcfg_ColorNewArticles</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
+    <connection>
+        <sender>kcfg_UseCustomColors</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>lbl_unreadArticles</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
+    <connection>
+        <sender>kcfg_UseCustomColors</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>lbl_newArticles</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
 </connections>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
-    <includehint>knuminput.h</includehint>
-    <includehint>knuminput.h</includehint>
     <includehint>kfontcombo.h</includehint>
-    <includehint>klineedit.h</includehint>
     <includehint>kfontcombo.h</includehint>
-    <includehint>klineedit.h</includehint>
     <includehint>kfontcombo.h</includehint>
-    <includehint>klineedit.h</includehint>
     <includehint>kfontcombo.h</includehint>
-    <includehint>klineedit.h</includehint>
+    <includehint>kcolorbutton.h</includehint>
+    <includehint>kcolorbutton.h</includehint>
 </includehints>
 </UI>
Index: akregator_view.cpp
===================================================================
--- akregator_view.cpp	(revision 577072)
+++ akregator_view.cpp	(working copy)
@@ -297,6 +297,8 @@
     connect( m_articleList, SIGNAL(signalDoubleClicked(const Article&, const \
                QPoint&, int)),
                 this, SLOT( slotOpenArticleExternal(const Article&, const QPoint&, \
int)) );  
+    connect( m_part, SIGNAL(signalSettingsChanged()), m_articleList, \
SLOT(slotPaletteOrFontChanged())); +    
     m_articleViewer = new ArticleViewer(m_articleSplitter, "article_viewer");
     m_articleViewer->setSafeMode();  // disable JS, Java, etc...
 



_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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