Skip to content

Commit

Permalink
Fix black scroll bar in items
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Sep 14, 2017
1 parent 726a77f commit 2cf96ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions plugins/itemweb/itemweb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ ItemWeb::ItemWeb(const QString &html, int maximumHeight, bool preview, QWidget *
page()->setPalette(pal);
setAttribute(Qt::WA_OpaquePaintEvent, false);

// FIXME: This makes black scroll bar.
setProperty("CopyQ_TEST", true);
setStyleSheet("*[CopyQ_TEST=\"true\"]{background-color:transparent}");

setContextMenuPolicy(Qt::NoContextMenu);

// Selecting text copies it to clipboard.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ void Theme::decorateBrowser(QAbstractScrollArea *c) const
"background:" + themeColorString("sel_bg") + ";"
"}"

"#item,#item #item_child{background:transparent}"
"#item[CopyQ_selected=\"true\"],#item[CopyQ_selected=\"true\"] #item_child{background:transparent}"
"#item #item_child{background:transparent}"
"#item[CopyQ_selected=\"true\"] #item_child{background:transparent}"

// Desaturate selected item background if item list is not focused.
"#ClipboardBrowser::item:selected:!active{"
Expand Down
4 changes: 4 additions & 0 deletions src/item/itemwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ ItemWidget::ItemWidget(QWidget *widget)

// Disable drag'n'drop by default.
widget->setAcceptDrops(false);

// Make background transparent.
widget->setAttribute(Qt::WA_NoSystemBackground);
widget->setAttribute(Qt::WA_TranslucentBackground);
}

void ItemWidget::setHighlight(const QRegExp &re, const QFont &highlightFont,
Expand Down

0 comments on commit 2cf96ee

Please sign in to comment.