bugGNU Octave - Bugs: bug #52800, The icon for dock widgets for...


bug #52800: The icon for dock widgets for *figure* windows needs improvement

Submitter:  Dan Sebald <sebald>
Submitted:  Wed 03 Jan 2018 09:09:38 PM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Wed 23 May 2018 05:02:11 PM UTC, comment #9: 

I have tested on KDE with Qt 5.5.1 and the floating dock widgets have the correct icons when selecting "letter" or "graphics" icons in the preferences.

Regarding the figure widget icons, I suggest to have an icon that is derived from the octave logo but which does not change with the preferences for the dock widget icons. Then, the behavior would be consistent with the figure window icons when using other graphics toolkits.

Torsten Lilge <ttl>
Group Member
Mon 21 May 2018 10:28:42 PM UTC, comment #8: 

I have no idea what is going wrong with the taskbar logos.  I've manually entered icon paths for setWindowIcon() and commented out the setWindowIcon() in various places.  Nothing seems to make a difference.  It's as if the application is using some default application logo for every taskbar icon, unaffected by any use of setWindowIcon().  Maybe it's a Qt bug.

Dan Sebald <sebald>
Mon 21 May 2018 08:39:39 PM UTC, comment #7: 

Ah, good point.  I don't see "setWindowIcon" in too many locations in the source, so perhaps something is setting the icon back to the base icon.

The location that the "Figure" icon has be set is within the file libgui/graphics/FigureWindow.cc:

  FigureWindow::FigureWindow (QWidget *xparent)
    : FigureWindowBase (xparent)
    // set icon from application resources
    setWindowIcon (QIcon (":/actions/icons/logo.png"));

Since the FigureWindow is not one of the main gui objects (i.e., octave_dock_widget) that code we've been discussing doesn't apply.  That's a bit problematic in the sense that the above could be changed easily to set the logo based on the settings (i.e., LETTER, GRAPHIC or NONE)--no problem.  But then if the user changes the icon type in the settings, there needs to be some additional code

  void main_window::notice_settings (const QSettings *settings)

that adjusts the icon in all open Figure windows.  That might be a bit more challenging because I don't know where to look to in order to determine the figure list.  The list might be embedded in core code, not the GUI subdirectory.

Dan Sebald <sebald>
Mon 21 May 2018 08:18:39 PM UTC, comment #6: 

This "/actions" path is a virtual one defined in libgui/src/resource.qrc:

<qresource prefix="/actions">

There are icons in this path, which are definitely working (e.g. close, (un)dock of dock widgets).

Torsten Lilge <ttl>
Group Member
Mon 21 May 2018 07:48:21 PM UTC, comment #5: 

I was just about to create a bug report for the non-working icons.  Let me know if I should.  It seems to me that the icons are missing or are in some path different than expected.  The paths/icons that the program are looking for are (printed std::cerr during run-time):


but I don't see an "actions" subdirectory anywhere in either the "run-octave" environment or in the install directory "/usr/local/share/octave/4.5.0+".  It seems something has gone wrong with the install process:

linux@ ~/octave/octave/octave $ find . -name "letter_logo*"
linux@ ~/octave/octave/octave $ find /usr/local/src/octave/octave/build1/ -name "letter_logo*"
linux@ ~/octave/octave/octave $ find /usr/local/share/octave/4.5.0+ -name "letter_logo*"

Dan Sebald <sebald>
Mon 21 May 2018 07:21:03 PM UTC, comment #4: 

Dan, you are right. I have made the same logical mistake twice!

The other icon sets do not work? On Unity, all windows are always grouped under the main icon. I will test under my Vbox with KDE.

Torsten Lilge <ttl>
Group Member
Mon 21 May 2018 06:20:17 PM UTC, comment #3: 

It's odd, but the graphic and letter icons don't seem to be working at the moment.  All I'm seeing is the main icon, regardless of what setting I choose.

Anyway, I understand the reason for having some default.  However, my point was that the construct isn't correct.  Perhaps writing out the alternative approach that I think is correct will help.

The original is:

(1)  ui->general_icon_octave->setChecked (true);  // the default (if invalid set)
(2)  ui->general_icon_octave->setChecked (widget_icon_set == "NONE");
(3)  ui->general_icon_graphic->setChecked (widget_icon_set == "GRAPHIC");
(4)  ui->general_icon_letter->setChecked (widget_icon_set == "LETTER");

Imagine there is some bogus setting in the settings file, i.e., not NONE, not GRAPHIC and not LETTER.  In that case immediately after line 1, the state of the button gets set back to false in line 2.  Instead, if it were done as

  if (widget_icon_set == "GRAPHIC")
    ui->general_icon_graphic->setChecked (true);
  else if (widget_icon_set == "LETTER")
    ui->general_icon_letter->setChecked (true);
    ui->general_icon_octave->setChecked (true);  // the default (if invalid set)

then the general_icon_octave is left in a "true" state, rather than a "false" state.

Dan Sebald <sebald>
Mon 21 May 2018 10:03:37 AM UTC, comment #2: 

I can provide an icon for the Qt figure windows but I have no idea where these have to be set. I agree to the idea of having the octave logo with a small superimposed plot. However, this logo should not depend on the preferences for the icon set of the dock widgets.

Torsten Lilge <ttl>
Group Member
Mon 21 May 2018 09:59:41 AM UTC, comment #1: 

Regarding the mentioned hunk of code:

The documentation for a QButtonGroup says:

"If you create an exclusive button group, you should ensure that one of the buttons in the group is initially checked; otherwise, the group will initially be in a state where no buttons are checked."

Setting the first button to true ensures to have one button initially checked in the case that the settings file contains the settings key "DockWidgets/widget_icon_set", but set to some nonsense string. This would lead to all three buttons left unckecked.

Torsten Lilge <ttl>
Group Member
Wed 03 Jan 2018 09:09:38 PM UTC, original submission:  

I've noticed that the logo used in the system dock works properly except the fact that plot figure windows have a real inconsistent behavior.  Since it is most often a bunch of figure windows that accumulate along the dock in typical use, it would be nice to somehow assign a proper PNG to those, if possible.

In gnuplot graphics toolkit, it is the standard gnuplot figure of a little plot with basic color lines on it.  In FLTK toolkit, it looks to be the default system icon which in this case is a black background with red "cross-out", or Ghost Busters :-), logo.  In Qt toolkit, it is the standard Octave logo (what would be "NONE" in GUI settings parlance).

In some sense it is the last case, Qt graphics toolkit, that is the most problematic because it mimics the main GUI icon.  I like having the main icon unique so that I can quickly find it.

What would be the best icon for a figure?  Perhaps just the standard Octave icon with the number of the window superimposed on it.  Otherwise, the logo with a small plot.

BTW, I notice this hunk of code:

  // which icon has to be selected
  QButtonGroup *icon_group = new QButtonGroup (this);
  icon_group->addButton (ui->general_icon_octave);
  icon_group->addButton (ui->general_icon_graphic);
  icon_group->addButton (ui->general_icon_letter);
  QString widget_icon_set =
    settings->value ("DockWidgets/widget_icon_set", "NONE").toString ();
  ui->general_icon_octave->setChecked (true);  // the default (if invalid set)
  ui->general_icon_octave->setChecked (widget_icon_set == "NONE");
  ui->general_icon_graphic->setChecked (widget_icon_set == "GRAPHIC");
  ui->general_icon_letter->setChecked (widget_icon_set == "LETTER");

doesn't set "NONE" as default as the comment says.  At least, the logic doesn't seem to do that.  It sets general_icon_octave to "true" initially, but then immediately after that sets general_icon_octave again.  Let's say widget_icon_set is "HUH?!".  Then all three of the above will be false at the end of this hunk.  In other words, right now that line that has "// the default (if invalid set)" effectively does nothing.

Dan Sebald <sebald>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-a0c1.
    Corresponding source code