weld: Move weld::Scale to own header

Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I2e42a2992c08311922451bb01062683bd81954fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205486
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-05-22 21:56:27 +02:00
parent 68ce3cfcb1
commit ee7e1d968b
14 changed files with 49 additions and 18 deletions
@@ -21,6 +21,7 @@
#include <ModifyListenerCallBack.hxx>
#include <TimerTriggeredControllerLock.hxx>
#include <vcl/weld/Builder.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/weld.hxx>
#include <svx/dlgctl3d.hxx>
#include <svx/float3d.hxx>
+1
View File
@@ -32,6 +32,7 @@
#include <vcl/weld/Entry.hxx>
#include <vcl/weld/IconView.hxx>
#include <vcl/weld/MetricSpinButton.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/SpinButton.hxx>
class ColorListBox;
+1
View File
@@ -21,6 +21,7 @@
#include <config_options.h>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/Entry.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/Toolbar.hxx>
#include <vcl/weld/weld.hxx>
+1
View File
@@ -25,6 +25,7 @@
#include <tools/link.hxx>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/DialogController.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/SpinButton.hxx>
#include <vcl/weld/Window.hxx>
#include <vcl/weld/weld.hxx>
+1
View File
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SVX_DLGCTL3D_HXX
#define INCLUDED_SVX_DLGCTL3D_HXX
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/customweld.hxx>
#include <vcl/weld/weld.hxx>
#include <svl/itemset.hxx>
+1
View File
@@ -26,6 +26,7 @@
#include <sfx2/dockwin.hxx>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/MetricSpinButton.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/SpinButton.hxx>
#include <vcl/weld/weld.hxx>
#include <svl/eitem.hxx>
@@ -36,6 +36,7 @@
#include <vcl/EnumContext.hxx>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/MetricSpinButton.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/Toolbar.hxx>
class ToolbarUnoDispatcher;
+36
View File
@@ -0,0 +1,36 @@
/* -*- 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/.
*/
#pragma once
#include <vcl/dllapi.h>
#include <vcl/weld/Widget.hxx>
namespace weld
{
class VCL_DLLPUBLIC Scale : virtual public Widget
{
Link<Scale&, void> m_aValueChangedHdl;
protected:
void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
public:
virtual void set_value(int value) = 0;
virtual int get_value() const = 0;
virtual void set_range(int min, int max) = 0;
virtual void set_increments(int step, int page) = 0;
virtual void get_increments(int& step, int& page) const = 0;
void connect_value_changed(const Link<Scale&, void>& rLink) { m_aValueChangedHdl = rLink; }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
-18
View File
@@ -287,24 +287,6 @@ public:
virtual void set_label_wrap(bool wrap) = 0;
};
class VCL_DLLPUBLIC Scale : virtual public Widget
{
Link<Scale&, void> m_aValueChangedHdl;
protected:
void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
public:
virtual void set_value(int value) = 0;
virtual int get_value() const = 0;
virtual void set_range(int min, int max) = 0;
virtual void set_increments(int step, int page) = 0;
virtual void get_increments(int& step, int& page) const = 0;
void connect_value_changed(const Link<Scale&, void>& rLink) { m_aValueChangedHdl = rLink; }
};
enum class LabelType
{
Normal,
+1
View File
@@ -23,6 +23,7 @@
#include <FltCallDialogParameter.hxx>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/DialogController.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/SpinButton.hxx>
#include <vcl/weld/weld.hxx>
#include <tools/stream.hxx>
@@ -13,6 +13,7 @@
#include <sfx2/sidebar/PanelLayout.hxx>
#include <vcl/weld/ComboBox.hxx>
#include <vcl/weld/MetricSpinButton.hxx>
#include <vcl/weld/Scale.hxx>
class ColorListBox;
+2
View File
@@ -13,6 +13,8 @@
#include "QtInstanceWidget.hxx"
#include <vcl/weld/Scale.hxx>
#include <QtWidgets/QSlider>
class QtInstanceScale : public QtInstanceWidget, public virtual weld::Scale
+1
View File
@@ -32,6 +32,7 @@
#include <vcl/weld/Notebook.hxx>
#include <vcl/weld/Popover.hxx>
#include <vcl/weld/ProgressBar.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/Scrollbar.hxx>
#include <vcl/weld/ScrolledWindow.hxx>
#include <vcl/weld/SpinButton.hxx>
+1
View File
@@ -56,6 +56,7 @@
#include <vcl/weld/Paned.hxx>
#include <vcl/weld/Popover.hxx>
#include <vcl/weld/ProgressBar.hxx>
#include <vcl/weld/Scale.hxx>
#include <vcl/weld/Scrollbar.hxx>
#include <vcl/weld/ScrolledWindow.hxx>
#include <vcl/weld/SizeGroup.hxx>