ecode: project tree ccrollBar style improvements.

This commit is contained in:
Martín Lucas Golini
2023-11-26 02:01:01 -03:00
parent e757e2f853
commit 7a7d64c4be
6 changed files with 22 additions and 11 deletions

View File

@@ -25,7 +25,7 @@ class EE_API UIScrollableWidget : public UIWidget {
const ScrollViewType& getViewType() const;
void setViewType( const ScrollViewType& viewType );
void setScrollViewType( const ScrollViewType& viewType );
UIScrollBar* getVerticalScrollBar() const;

View File

@@ -92,8 +92,6 @@ class EE_API UIScrollBar : public UIWidget {
virtual void onAutoSize();
virtual Uint32 onMouseOver( const Vector2i& position, const Uint32& flags );
void adjustChilds();
void onValueChangeCb( const Event* Event );

View File

@@ -397,7 +397,7 @@ Uint32 Node::onMouseLeave( const Vector2i& Pos, const Uint32& Flags ) {
return 1;
}
Uint32 Node::onMouseWheel( const Vector2f& offset, bool flipped ) {
Uint32 Node::onMouseWheel( const Vector2f&, bool ) {
return 1;
}

View File

@@ -76,7 +76,7 @@ const UIScrollableWidget::ScrollViewType& UIScrollableWidget::getViewType() cons
return mViewType;
}
void UIScrollableWidget::setViewType( const ScrollViewType& viewType ) {
void UIScrollableWidget::setScrollViewType( const ScrollViewType& viewType ) {
if ( viewType != mViewType ) {
mViewType = viewType;
onContentSizeChange();
@@ -304,9 +304,9 @@ bool UIScrollableWidget::applyProperty( const StyleSheetProperty& attribute ) {
std::string val( attribute.asString() );
String::toLowerInPlace( val );
if ( "inclusive" == val || "inside" == val )
setViewType( Inclusive );
setScrollViewType( Inclusive );
else if ( "exclusive" == val || "outside" == val )
setViewType( Exclusive );
setScrollViewType( Exclusive );
break;
}
case PropertyId::VScrollMode: {

View File

@@ -181,10 +181,6 @@ void UIScrollBar::onAutoSize() {
}
}
Uint32 UIScrollBar::onMouseOver( const Vector2i&, const Uint32& ) {
return 1;
}
void UIScrollBar::onSizeChange() {
onAutoSize();
@@ -263,6 +259,14 @@ void UIScrollBar::adjustChilds() {
Uint32 UIScrollBar::onMessage( const NodeMessage* Msg ) {
switch ( Msg->getMsg() ) {
case NodeMessage::DragStart: {
addClass( "dragging" );
return 1;
}
case NodeMessage::DragStop: {
removeClass( "dragging" );
return 1;
}
case NodeMessage::MouseClick: {
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
if ( Msg->getSender() == mBtnUp ) {

View File

@@ -397,6 +397,15 @@ Anchor.error:hover {
#code_container Tab:hover > Tab::close {
opacity: 1;
}
#project_view ScrollBar {
opacity: 0;
transition: opacity 0.15;
}
#project_view:hover ScrollBar,
#project_view ScrollBar.dragging,
#project_view ScrollBar:focus-within {
opacity: 1;
}
</style>
<MainLayout id="main_layout" lw="mp" lh="mp">
<Splitter id="project_splitter" lw="mp" lh="mp">