/*
 * Copyright (C) 2020, KylinSoft Co., Ltd.
 *
 * 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 <https://www.gnu.org/licenses/>.
 */
#include "sidelist.h"
#include "global/interactiveqml.h"
#include "global/variable.h"
#include "controller/interaction.h"
#include "sizedate.h"
SideList::SideList(QWidget *parent) : kdk::KListView(parent)
{
    QPalette pal;
    //设置背景色
    pal.setColor(QPalette::Base, QColor(Qt::transparent));
    this->setPalette(pal);
}
void SideList::mouseReleaseEvent(QMouseEvent *e)
{
    Variable::g_nextOrPreviousTiff = false;
    //处理滑动，或拖出相册时，相册选中态和主界面显示的图片保持一致
    Interaction::getInstance()->changeImageFromClick(this->currentIndex());
    this->setCurrentIndex(this->currentIndex());
    operayteMode = OperayteMode::ChangeImage;
    InteractiveQml::getInstance()->setOperateWay(int(operayteMode));
    QWidget::mouseReleaseEvent(e);
}
