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

List:       kde-usability
Subject:    Re: Toolbar item separators: spacer vs. line
From:       Sandro Giessl <ceebx () users ! sourceforge ! net>
Date:       2004-02-07 19:24:58
Message-ID: 200402072024.58420.ceebx () users ! sourceforge ! net
[Download RAW message or body]

Am Thursday 05 February 2004 23:26 schrieb Aaron Seigo:
> On February 5, 2004 14:56, Sandro Giessl wrote:
> > Hi all,
> >
> > I'm not happy with the way toolbar item separators are handled by
> > the KXMLGUIFactory.
> > There are two sorts of seperators:
> > - blank spacer: It's defined with "<Separator/>" in KDE's .rc
> > files, is the default and most KDE apps are using it.
> > http://www.tnt22.com/files_sandro/spacesep.png
> > - line separator: Defined with something like "<Separator
> > lineSeparator="true"/>". Only very few apps are using it and it's
> > not possible to add it with the "Configure Toolbars...". To get it,
> > you have to hack the .ui file by hand.
> > http://www.tnt22.com/files_sandro/linesep.png
>
> this reminds me that we (i? =) need to work on the Configure Toolbars
> dialog for this release. in particular:
>
>  o a Defaults button
>  o ability to re-add merge points
>  o hiding the toolbar combobox if there is only one toolbar to
> configure o when a toolbar is merged, show the items for that toolbar
> at the merge point so that the user doesn't have to hunt down the
> right toolbar in the combobox
>  o do SOMEthing with the combobox that's nicer than what's there
> right now in the case of multiple toolbars?

Some really nice ideas, indeed. :)
And for an easier action arrangement, some drag&drop abilities would be 
cools also.

> > I would like to propose two usability improvements:
> > - It sould be possible to distinguish between them in the toolbar
> > dialog, maybe call the one "--- Spacer ---" and the other "--- Line
> > ---" or what ever. This would make it possible for those who prefer
> > one kind of separator in favor of the other to configure their
> > toolbars for their needs.
> > - I think line separators should definitely be made default -- add
> > "<Separator/>" to get the line and disable the line using
> > "<Separator lineSeparator="false"/>".
> > The spacers are just too inconspicuous and thus they serve almost
> > no usability purpose. IMHO all they do is to make the toolbars look
> > even more cluttered as they are; visually impaired people might not
> > even notice them.
>
> this really depends on the style ... nicely implemented line
> separators are nice, but not all styles have nice looking line seps.

At least all KDE styles seem to implement line separators fine. They 
look a bit strange in some Qt styles, but in my opinion KDE shouldn't 
take care of them as long as the default style looks ok and gets 
improved usaility wise (well, I think it gets, but as the feedback to 
this thread shows, most people probably don't care ;) ).

> for styles like Plastik and Keramik they are nicer indeed...
>
> > What do you think?
>
> would be cool to at least try out and test...

Ok, I think so, too, and personally I like the result very much. :)
The attached patch:
- makes line separators default
- makes KEditToolbarWidget distinguish between simple separators and 
line separators (http://www.tnt22.com/files_sandro/newkedittoolbar.png)

regards,
  Sandro

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

? kpartgui_separators.diff
Index: kedittoolbar.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kedittoolbar.cpp,v
retrieving revision 1.82
diff -u -p -r1.82 kedittoolbar.cpp
--- kedittoolbar.cpp	3 Nov 2003 17:01:17 -0000	1.82
+++ kedittoolbar.cpp	7 Feb 2004 18:39:45 -0000
@@ -648,6 +648,7 @@ void KEditToolbarWidget::loadActionList(
   static const QString &tagMerge     = KGlobal::staticQString( "Merge" );
   static const QString &tagActionList= KGlobal::staticQString( \
"ActionList" );  static const QString &attrName     = \
KGlobal::staticQString( "name" ); +  static const QString \
&attrLineSeparator = KGlobal::staticQString( "lineseparator" );  
   int     sep_num = 0;
   QString sep_name("separator_%1");
@@ -670,7 +671,11 @@ void KEditToolbarWidget::loadActionList(
     if (it.tagName() == tagSeparator)
     {
       ToolbarItem *act = new ToolbarItem(m_activeList, tagSeparator, \
                sep_name.arg(sep_num++), QString::null);
-      act->setText(1, "-----");
+      bool isLineSep = ( it.attribute(attrLineSeparator, "true").lower() \
== QString::fromLatin1("true") ); +      if(isLineSep)
+        act->setText(1, i18n("--- line separator ---"));
+      else
+        act->setText(1, i18n("--- separator ---"));
       it.setAttribute( attrName, act->internalName() );
       continue;
     }
@@ -735,9 +740,11 @@ void KEditToolbarWidget::loadActionList(
         act->setPixmap(0, action->iconSet(KIcon::Toolbar).pixmap());
   }
 
-  // finally, add a default separator to the inactive list
+  // finally, add default separators to the inactive list
   ToolbarItem *act = new ToolbarItem(m_inactiveList, tagSeparator, \
                sep_name.arg(sep_num++), QString::null);
-  act->setText(1, "-----");
+  act->setText(1, i18n("--- line separator ---"));
+  act = new ToolbarItem(m_inactiveList, tagSeparator, \
sep_name.arg(sep_num++), QString::null); +  act->setText(1, i18n("--- \
separator ---"));  }
 
 KActionCollection *KEditToolbarWidget::actionCollection() const
@@ -842,6 +849,7 @@ void KEditToolbarWidget::slotInsertButto
   static const QString &tagAction    = KGlobal::staticQString( "Action" );
   static const QString &tagSeparator = KGlobal::staticQString( "Separator" \
);  static const QString &attrName     = KGlobal::staticQString( "name" );
+  static const QString &attrLineSeparator = KGlobal::staticQString( \
"lineseparator" );  
   // we're modified, so let this change
   emit enableOk(true);
@@ -850,9 +858,12 @@ void KEditToolbarWidget::slotInsertButto
 
   QDomElement new_item;
   // let's handle the separator specially
-  if (item->text(1) == "-----")
+  if (item->text(1) == i18n("--- line separator ---"))
     new_item = domDocument().createElement(tagSeparator);
-  else
+  else if (item->text(1) == i18n("--- separator ---")) {
+    new_item = domDocument().createElement(tagSeparator);
+    new_item.setAttribute(attrLineSeparator, "false");
+  } else
     new_item = domDocument().createElement(tagAction);
   new_item.setAttribute(attrName, item->internalName());
 
Index: kpartgui.dtd
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kpartgui.dtd,v
retrieving revision 1.16
diff -u -p -r1.16 kpartgui.dtd
--- kpartgui.dtd	4 Jan 2004 13:56:46 -0000	1.16
+++ kpartgui.dtd	7 Feb 2004 18:39:45 -0000
@@ -110,7 +110,7 @@
 <!-- Inserts a separator item into a menubar or toolbar -->
 <!ELEMENT Separator EMPTY>
 <!ATTLIST Separator
-  lineSeparator (true|false) "false"
+  lineSeparator (true|false) "true"
   group CDATA #IMPLIED
 >
 
Index: kxmlguibuilder.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kxmlguibuilder.cpp,v
retrieving revision 1.62
diff -u -p -r1.62 kxmlguibuilder.cpp
--- kxmlguibuilder.cpp	18 Aug 2003 21:50:37 -0000	1.62
+++ kxmlguibuilder.cpp	7 Feb 2004 18:39:46 -0000
@@ -317,7 +317,7 @@ int KXMLGUIBuilder::createCustomElement(
     {
       KToolBar *bar = static_cast<KToolBar *>( parent );
 
-      bool isLineSep = false;
+      bool isLineSep = true;
 
       QDomNamedNodeMap attributes = element.attributes();
       unsigned int i = 0;
@@ -326,9 +326,9 @@ int KXMLGUIBuilder::createCustomElement(
         QDomAttr attr = attributes.item( i ).toAttr();
 
         if ( attr.name().lower() == d->attrLineSeparator &&
-             attr.value().lower() == QString::fromLatin1("true") )
+             attr.value().lower() == QString::fromLatin1("false") )
         {
-          isLineSep = true;
+          isLineSep = false;
           break;
         }
       }



_______________________________________________
kde-usability mailing list
kde-usability@kde.org
https://mail.kde.org/mailman/listinfo/kde-usability


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

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