mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-10-31 05:13:40 +00:00 
			
		
		
		
	add workaround for #34 to AW
This commit is contained in:
		| @ -219,7 +219,9 @@ void AwesomeWidget::init() | ||||
|     mainLayout->setContentsMargins(1, 1, 1, 1); | ||||
|     setLayout(mainLayout); | ||||
|     textLabel = new CustomLabel(this, debug); | ||||
|     textLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); | ||||
|     QGraphicsProxyWidget *pw = new QGraphicsProxyWidget(this); | ||||
|     pw->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); | ||||
|     textLabel->setAttribute(Qt::WA_TranslucentBackground, true); | ||||
|     pw->setWidget(textLabel); | ||||
|     mainLayout->addItem(pw, 0, 0); | ||||
|  | ||||
| @ -662,7 +662,7 @@ void AwesomeWidget::configChanged() | ||||
|         fontStyle = QString("italic"); | ||||
|     else | ||||
|         fontStyle = QString("normal"); | ||||
|     formatLine[0] = QString("<html><head><style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\ | ||||
|     formatLine[0] = QString("<html><head><style type=\"text/css\">body { white-space: pre-wrap; }</style>\ | ||||
|                             </head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\">") | ||||
|             .arg(font.family()) | ||||
|             .arg(font.pointSize()) | ||||
|  | ||||
| @ -93,5 +93,5 @@ void CustomLabel::mousePressEvent(QMouseEvent *event) | ||||
|  | ||||
|         widget->sendNotification(QString("system"), text); | ||||
|     } | ||||
|     emit(QLabel::mousePressEvent(event)); | ||||
|     emit(QWidget::mousePressEvent(event)); | ||||
| } | ||||
|  | ||||
| @ -38,8 +38,6 @@ void AwesomeWidget::reinit() | ||||
|     else | ||||
|         textLabel->setPopupEnabled(true); | ||||
|     updateText(true); | ||||
|     textLabel->adjustSize(); | ||||
|     mainLayout->itemAt(0, 0)->setGeometry(textLabel->geometry()); | ||||
|  | ||||
|     keys = getKeys(); | ||||
|     foundKeys = findKeys(); | ||||
| @ -86,7 +84,8 @@ void AwesomeWidget::updateText(const bool clear) | ||||
|         text.replace(QString("$\\$\\"), QString("$$")); | ||||
|     } | ||||
|     textLabel->setText(formatLine[0] + text + formatLine[1]); | ||||
|     update(); | ||||
|     mainLayout->itemAt(0, 0)->updateGeometry(); | ||||
|     updateGeometry(); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user