2021-05-20 14:17:33 +02:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
* MuseScore-CLA-applies
|
|
|
|
*
|
|
|
|
* MuseScore
|
|
|
|
* Music Composition & Notation
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 MuseScore BVBA and others
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 3 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2021-05-24 16:10:12 +02:00
|
|
|
#include "docktoolbarholder.h"
|
2021-05-20 14:17:33 +02:00
|
|
|
|
|
|
|
using namespace mu::dock;
|
|
|
|
|
2021-10-31 20:57:42 +01:00
|
|
|
constexpr int DOCK_TOOLBAR_HOLDER_SIZE = 36;
|
|
|
|
|
2021-05-24 16:10:12 +02:00
|
|
|
DockToolBarHolder::DockToolBarHolder(QQuickItem* parent)
|
2021-10-08 14:55:00 +02:00
|
|
|
: DockToolBarView(parent)
|
2021-05-20 14:17:33 +02:00
|
|
|
{
|
|
|
|
setVisible(false);
|
|
|
|
}
|
|
|
|
|
2021-05-24 16:10:12 +02:00
|
|
|
void DockToolBarHolder::componentComplete()
|
2021-05-20 14:17:33 +02:00
|
|
|
{
|
2021-10-08 14:55:00 +02:00
|
|
|
DockToolBarView::componentComplete();
|
2021-05-21 10:45:04 +02:00
|
|
|
|
2021-05-20 14:17:33 +02:00
|
|
|
switch (location()) {
|
|
|
|
case DockLocation::Left:
|
|
|
|
case DockLocation::Right:
|
2021-10-31 20:57:42 +01:00
|
|
|
setWidth(DOCK_TOOLBAR_HOLDER_SIZE);
|
|
|
|
setMinimumWidth(DOCK_TOOLBAR_HOLDER_SIZE);
|
|
|
|
setMaximumWidth(DOCK_TOOLBAR_HOLDER_SIZE * 2);
|
2021-05-20 14:17:33 +02:00
|
|
|
break;
|
|
|
|
case DockLocation::Top:
|
|
|
|
case DockLocation::Bottom:
|
2021-10-31 20:57:42 +01:00
|
|
|
setHeight(DOCK_TOOLBAR_HOLDER_SIZE);
|
|
|
|
setMinimumHeight(DOCK_TOOLBAR_HOLDER_SIZE);
|
|
|
|
setMaximumHeight(DOCK_TOOLBAR_HOLDER_SIZE);
|
2021-10-21 12:40:53 +02:00
|
|
|
break;
|
2021-05-21 10:45:04 +02:00
|
|
|
case DockLocation::Center:
|
|
|
|
case DockLocation::Undefined:
|
2021-05-20 14:17:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-24 16:10:12 +02:00
|
|
|
DockType DockToolBarHolder::type() const
|
2021-05-20 14:17:33 +02:00
|
|
|
{
|
2021-05-24 16:10:12 +02:00
|
|
|
return DockType::ToolBarDockingHolder;
|
2021-05-20 14:17:33 +02:00
|
|
|
}
|