UBLeftPalette.cpp 1.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * 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 <http://www.gnu.org/licenses/>.
 */
#include "UBLeftPalette.h"
16
#include "core/UBSettings.h"
17

18 19 20
/**
 * \brief The constructor
 */
21 22 23 24 25
UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):UBDockPalette(parent)
{
    setObjectName(name);
    setOrientation(eUBDockOrientation_Left);
    mLastWidth = 300;
26
    mCollapseWidth = 180;
27

28
    resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), parentWidget()->height());
29 30 31 32
    mpLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin());

}

33 34 35
/**
 * \brief The destructor
 */
36 37
UBLeftPalette::~UBLeftPalette()
{
38

39 40
}

41 42 43
/**
 * \brief Update the maximum width
 */
44 45 46 47 48
void UBLeftPalette::updateMaxWidth()
{
    setMaximumWidth(300);
}

49 50 51 52
/**
 * \brief Handle the resize event
 * @param event as the resize event
 */
53 54 55 56 57
void UBLeftPalette::resizeEvent(QResizeEvent *event)
{
    UBDockPalette::resizeEvent(event);
    UBSettings::settings()->navigPaletteWidth->set(width());
}