office-gobmx/vcl/qt6/QtExpander.cxx
Michael Weghorn 9ca43e71e2 tdf#130857 qt weld: Implement "GtkExpander" equivalent
Implement support for "GtkExpander" objects in .ui
files. As Qt doesn't seem to have any equivalent, add
a new QtExpander class that subclasses QWidget and
has a button that can be used to toggle visibility
of the widget that is the GtkExpander's [1] content child.

For a visual appearance similar to GtkExpander,
set an icon for the button ("go-down" and "go-next"
from the icon theme, which are arrows like the ones
shown on a GtkExpander, at least with the Breeze
icon theme).

In QtBuilder, implement handling for "GtkExpander"
objects:

* Create an instance of the new QtExpander
  class.

* Identify the content child, which can be distinguished
  from the label child by the fact that the latter
  has a "label" child type set, see also previous
  commit

    Change-Id: I3e308a6642d72b55d0ccc597dac716b236c22d61
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sat Nov 23 20:54:47 2024 +0100

        tdf#130857 Pass child type to WidgetBuilder::insertObject

* Erase the "visible" property for the content child,
  as otherwise the content widget would be initially
  visible even if the expander is set to not be
  expanded. (QtExpander takes care of this, so
  ignore the property set in the .ui file.)

* For the label child in GtkExpander, simply take
  over its text to QtExpander's button, then mark
  the label for deletion, as it's not needed
  otherwise.

Support for the "Document in Use" dialog that
has a GtkExpander and thuse makes use of this
will be declared in a separate commit.

[1] https://docs.gtk.org/gtk3/class.Expander.html

Change-Id: Id2366834cb542eba613ea087e70f3a812d20fa89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177193
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-24 17:04:18 +01:00

12 lines
484 B
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "../qt5/QtExpander.cxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */