Warning, /maui/mauikit/src/controls.5/SplitView.qml is written in an unsupported language. File is not indexed.
0001 // Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
0002 // Copyright 2018-2020 Nitrux Latinoamericana S.C.
0003 //
0004 // SPDX-License-Identifier: GPL-3.0-or-later
0005
0006
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15
0009
0010 import org.mauikit.controls 1.3 as Maui
0011
0012 SplitView
0013 {
0014 id: control
0015
0016 clip: false
0017
0018 onCurrentItemChanged:
0019 {
0020 currentItem.forceActiveFocus()
0021 }
0022
0023 function closeSplit(index)
0024 {
0025 if(control.count === 1)
0026 {
0027 return // do not close aall
0028 }
0029
0030 control.removeItem(control.takeItem(index))
0031 }
0032
0033 function addSplit(component, properties)
0034 {
0035 const object = component.createObject(control.contentModel, properties);
0036
0037 control.addItem(object)
0038 control.currentIndex = Math.max(control.count -1, 0)
0039 object.forceActiveFocus()
0040
0041 return object
0042 }
0043 }