octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53276] GUI: undocked panes cannot be moved, o


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53276] GUI: undocked panes cannot be moved, or resized along upper border
Date: Fri, 16 Mar 2018 02:54:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #31, bug #53276 (project octave):

I'm attaching a patch that does two things compared to the previous patch.

One, it restores highlighting for octave_dock_widget in what should be exactly
the same prior to the patch.  It uses style sheets for the QDockWidget:

http://doc.qt.io/archives/qt-4.8/stylesheet-reference.html#list-of-stylable-widgets

in particular QDockWidget::title using the same background definition used for
the custom title (see function set_style()).

Two, I've found a better way of doing the non-float-button methods of creating
a top-level window with full decorations, i.e., the drag out of QMainWIndow
and double-click on the title bar.  It no longer involves changeEvent() and
the event filter.  Instead it uses a temporary connection to watch for focus
change and after that change the signal/slot disconnects.  That way there
isn't the extra bits of code continually watching the event stream.  The best
summary of the logic is to look at the slot for toplevelChanged():


  void
  octave_dock_widget::toplevel_change (bool toplevel)
  {
    QObject *dockobj;
    const char *docksig;

    if (titleBarWidget ())
      {
        dockobj = m_dock_action;
        docksig = SIGNAL (triggered (bool));
      }
    else
      {
        dockobj = m_default_float_button;
        docksig = SIGNAL (clicked (bool));
      }

    if (toplevel)
      {
        // This is a fallback in case the attempt to create a floated
        // top-level window fails and the QDockWidget remains a child
        // of the QMainWindow.
        connect (dockobj, docksig, this, SLOT (default_dock (bool)));

        // Could be dragging window, so must wait until there is a
        // change in focus.
        if (parent () != 0)
          connect (qApp, SIGNAL (focusChanged (QWidget *, QWidget *)),
                   this, SLOT (make_window_on_one_focus_change (QWidget *,
QWidget *)));
      }
    else
      {
        connect (dockobj, docksig, this, SLOT (make_window (bool)));

        // Making into a widget immediately will mangle the double-click
        // status and cause problems on followup button clicks.
        if (parent () == 0)
          emit queue_make_widget ();
      }
  }


It wouldn't surprise if the above construct doesn't even require connections
to the default float and close buttons to function properly.  But for now, "if
it isn't broke, don't fix it" holds true.  I find it much easier to understand
when there is a stable point to deviate from.

I see a number of small issues here and there, but they are the variety I'd
prefer to address with other bug reports because most of them are something
prior to this changeset.

(file #43567)
    _______________________________________________________

Additional Item Attachment:

File name: octave-float_as_toplevel-djs2018mar16.patch Size:35 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53276>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]