添加了默认视图图标,修复了替换视图的小bug
This commit is contained in:
parent
2af38a4937
commit
df2d145809
|
@ -130,11 +130,17 @@ void accept_panel::AcceptPanel::dropEvent(QDropEvent *ev)
|
||||||
view_manager->doRetrieve(view);
|
view_manager->doRetrieve(view);
|
||||||
view_manager->siblingAttach(view, anchor_view, SplitType::SPLIT_V_BFIRST);
|
view_manager->siblingAttach(view, anchor_view, SplitType::SPLIT_V_BFIRST);
|
||||||
break;
|
break;
|
||||||
case HoverType::CUBE_CENTER:
|
case HoverType::CUBE_CENTER: {
|
||||||
view_manager->doRetrieve(view);
|
view_manager->doRetrieve(view);
|
||||||
anchor_view->parentRes()->replaceView(view, anchor_view);
|
auto pinst = anchor_view->parentRes();
|
||||||
view_manager->doRetrieve(anchor_view);
|
if(pinst){
|
||||||
break;
|
pinst->replaceView(view, anchor_view);
|
||||||
|
view_manager->doRetrieve(anchor_view);
|
||||||
|
}else{
|
||||||
|
view_manager->doRetrieve(anchor_view);
|
||||||
|
dynamic_cast<split_window::SplitWindow*>(view_manager)->setPresentTarget(view);
|
||||||
|
}
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ using namespace dock_panel;
|
||||||
DragHeader::DragHeader(const QString &title, DockableView *bind_core)
|
DragHeader::DragHeader(const QString &title, DockableView *bind_core)
|
||||||
: QFrame(bind_core),
|
: QFrame(bind_core),
|
||||||
bind_core(bind_core),
|
bind_core(bind_core),
|
||||||
|
icon_holder(new QLabel(this)),
|
||||||
title_holder(new QLabel(this)),
|
title_holder(new QLabel(this)),
|
||||||
close_btn(new QPushButton("x",this)),
|
close_btn(new QPushButton("x",this)),
|
||||||
minimal_btn(new QPushButton("-",this)) {
|
minimal_btn(new QPushButton("-",this)) {
|
||||||
|
@ -22,6 +23,9 @@ DragHeader::DragHeader(const QString &title, DockableView *bind_core)
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
icon_holder->setPixmap(QIcon(":/icons/headertop/story.png").pixmap(22,22));
|
||||||
|
layout->addWidget(icon_holder, 0, Qt::AlignLeft);
|
||||||
|
|
||||||
title_holder->setText(title);
|
title_holder->setText(title);
|
||||||
title_holder->setContentsMargins(2,0, 0, 0);
|
title_holder->setContentsMargins(2,0, 0, 0);
|
||||||
layout->addWidget(title_holder, 1, Qt::AlignLeft);
|
layout->addWidget(title_holder, 1, Qt::AlignLeft);
|
||||||
|
@ -51,7 +55,7 @@ void DragHeader::setTitle(const QString &title)
|
||||||
void DragHeader::setTitle(const QString &title, const QIcon &icon)
|
void DragHeader::setTitle(const QString &title, const QIcon &icon)
|
||||||
{
|
{
|
||||||
this->setTitle(title);
|
this->setTitle(title);
|
||||||
this->title_holder->setPixmap(icon.pixmap(22, 22));
|
this->icon_holder->setPixmap(icon.pixmap(22, 22));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DragHeader::optConfig(bool retrieve, bool close)
|
void DragHeader::optConfig(bool retrieve, bool close)
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace dock_panel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
DockableView *const bind_core;
|
DockableView *const bind_core;
|
||||||
|
QLabel *const icon_holder;
|
||||||
QLabel *const title_holder;
|
QLabel *const title_holder;
|
||||||
QPushButton *const close_btn, *const minimal_btn;
|
QPushButton *const close_btn, *const minimal_btn;
|
||||||
std::tuple<bool, QPointF> press_flag = std::make_tuple(false, QPointF());
|
std::tuple<bool, QPointF> press_flag = std::make_tuple(false, QPointF());
|
||||||
|
|
|
@ -44,6 +44,7 @@ void SplitWindow::setPresentTarget(split_frame::ViewRes *inst)
|
||||||
inst->setParentRes(nullptr);
|
inst->setParentRes(nullptr);
|
||||||
inst->widget()->setParent(this);
|
inst->widget()->setParent(this);
|
||||||
this->setCentralWidget(inst->widget());
|
this->setCentralWidget(inst->widget());
|
||||||
|
inst->setVisible(true);
|
||||||
} else if (!inst) {
|
} else if (!inst) {
|
||||||
this->takeCentralWidget();
|
this->takeCentralWidget();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/icons/headertop">
|
||||||
|
<file>story.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -40,3 +40,6 @@ else:unix: LIBS += -L$$OUT_PWD/../libConfig/ -llibConfig
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../libConfig
|
INCLUDEPATH += $$PWD/../libConfig
|
||||||
DEPENDPATH += $$PWD/../libConfig
|
DEPENDPATH += $$PWD/../libConfig
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
defaulticon.qrc
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Loading…
Reference in New Issue