Skip to content

Commit

Permalink
refs edbee#13, Added a method to disable the scrollarea shadows: widg…
Browse files Browse the repository at this point in the history
…et->textScrollArea()->enableShadowWidget(bool)
  • Loading branch information
gamecreature committed May 23, 2017
1 parent 17476de commit 4f106d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

edbee.lib:

- fix #13, Added a method to disable the scrollarea shadows: widget->textScrollArea()->enableShadowWidget(bool)
- fix #9, Updated onigmo library. Fixes compilation/linkage issue on Mac OS X (enc/windows_31j.c)
- fix, Fixed build warnings via een #pragma for the onig library. (When updating vendor/onig, include "config-onig-edbee.h" in "config.h")
- fix #5, Incorrect memory access after coalescing in TextDocument::ReplaceRangeSet. (Crash on Linux/Windows)
Expand Down
10 changes: 8 additions & 2 deletions edbee-lib/edbee/views/texteditorscrollarea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ TextEditorScrollArea::TextEditorScrollArea(QWidget* parent)
, shadowWidgetRef_(0)
{
shadowWidgetRef_ = new PrivateShadowWidget(this);
leftWidgetRef_ = shadowWidgetRef_ ;
setFrameShape(QFrame::NoFrame);
setFocusPolicy(Qt::NoFocus);
}
Expand Down Expand Up @@ -180,7 +179,9 @@ void TextEditorScrollArea::layoutMarginWidgets()
setViewportMargins( left, top, right, bottom );

// overlay the shadow over the viewport
this->shadowWidgetRef_->setGeometry( viewport()->geometry() );
if( shadowWidgetRef_ ) {
this->shadowWidgetRef_->setGeometry( viewport()->geometry() );
}

// set the widget
if( leftWidgetRef_) {
Expand All @@ -205,6 +206,11 @@ void TextEditorScrollArea::layoutMarginWidgets()

}

void TextEditorScrollArea::enableShadowWidget(bool enabled)
{
shadowWidgetRef_->setVisible(enabled);
}


void TextEditorScrollArea::resizeEvent(QResizeEvent* event)
{
Expand Down
11 changes: 1 addition & 10 deletions edbee-lib/edbee/views/texteditorscrollarea.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,14 @@ class TextEditorScrollArea : public QScrollArea
void setRightWidget(QWidget* widget);
void setBottomWidget(QWidget* widget);


public:

void layoutMarginWidgets();

void enableShadowWidget(bool enabled);

protected:
virtual void resizeEvent(QResizeEvent* event);

public:
void renderShade(QPaintEvent *event, QPainter* painter );


signals:
public slots:

private:

QWidget* leftWidgetRef_; ///< The left widget
Expand All @@ -51,7 +43,6 @@ public slots:
QWidget* bottomWidgetRef_; ///< The bottom widget
PrivateShadowWidget* shadowWidgetRef_; ///< The private shadow widget


};

} // edbee

0 comments on commit 4f106d2

Please sign in to comment.