File indexing completed on 2024-12-22 04:13:14
0001 /* 0002 * This file is part of Krita 0003 * 0004 * SPDX-FileCopyrightText: 2020 L. E. Segovia <amy@amyspark.me> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KIS_SEEXPR_SCRIPT_CHOOSER_H_ 0010 #define KIS_SEEXPR_SCRIPT_CHOOSER_H_ 0011 0012 #include <QFrame> 0013 #include <kritaui_export.h> 0014 #include <KSqueezedTextLabel> 0015 #include <KisResourceItemChooser.h> 0016 0017 class KRITAUI_EXPORT KisSeExprScriptChooser : public QFrame 0018 { 0019 0020 Q_OBJECT 0021 0022 public: 0023 KisSeExprScriptChooser(QWidget *parent = 0); 0024 ~KisSeExprScriptChooser() override; 0025 0026 /// Gets the currently selected resource 0027 /// @returns the selected resource, 0 is no resource is selected 0028 KoResourceSP currentResource(); 0029 void setCurrentScript(KoResourceSP resource); 0030 void setCurrentItem(int row); 0031 /// determines whether the preview right or below the splitter 0032 void setPreviewOrientation(Qt::Orientation orientation); 0033 0034 Q_SIGNALS: 0035 0036 /// Emitted when a resource was selected 0037 void resourceSelected(KoResourceSP resource); 0038 void updateItemSize(); 0039 0040 private Q_SLOTS: 0041 0042 void update(KoResourceSP resource); 0043 0044 private: 0045 0046 KSqueezedTextLabel *m_lblName; 0047 KisResourceItemChooser *m_itemChooser; 0048 }; 0049 0050 #endif // KIS_SEEXPR_SCRIPT_CHOOSER_H_ 0051