mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 15:36:26 +00:00
Qt: add ability to style richtext href links
This commit is contained in:
parent
0ebe832f8e
commit
fcfca6efda
17 changed files with 95 additions and 20 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "qt_utils.h"
|
||||
#include "gui_settings.h"
|
||||
#include <QApplication>
|
||||
#include <QBitmap>
|
||||
#include <QDesktopServices>
|
||||
|
|
@ -198,6 +199,26 @@ namespace gui
|
|||
return l.sizeHint().width();
|
||||
}
|
||||
|
||||
QColor get_link_color(const QString& name)
|
||||
{
|
||||
return gui::utils::get_label_color(name);
|
||||
}
|
||||
|
||||
QString get_link_color_string(const QString& name)
|
||||
{
|
||||
return get_link_color(name).name();
|
||||
}
|
||||
|
||||
QString get_link_style(const QString& name)
|
||||
{
|
||||
if (!gui::stylesheet.contains(name))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
return QString("style=\"color: %0;\"").arg(get_link_color_string(name));
|
||||
}
|
||||
|
||||
QPixmap get_centered_pixmap(QPixmap pixmap, const QSize& icon_size, int offset_x, int offset_y, qreal device_pixel_ratio, Qt::TransformationMode mode)
|
||||
{
|
||||
// Create empty canvas for expanded image
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue