Skip to content

Commit

Permalink
Merge pull request #152 from taj-ny/about
Browse files Browse the repository at this point in the history
kcm: add about page
  • Loading branch information
taj-ny authored Jan 2, 2025
2 parents 9a38549 + 387b9d6 commit 2052564
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/kcm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
set(kwin_better_blur_config_SRCS blur_config.cpp blur_config.h)
set(kwin_better_blur_config_SRCS
blur_config.cpp
blur_config.h
blur_config.qrc
)

ki18n_wrap_ui(kwin_better_blur_config_SRCS blur_config.ui)
kconfig_add_kcfg_files(kwin_better_blur_config_SRCS ../blurconfig.kcfgc)
Expand All @@ -14,3 +18,5 @@ target_link_libraries(kwin_better_blur_config
)

install(TARGETS kwin_better_blur_config DESTINATION ${KDE_INSTALL_PLUGINDIR}/kwin/effects/configs)

add_compile_definitions(ABOUT_VERSION_STRING="${PROJECT_VERSION}")
12 changes: 12 additions & 0 deletions src/kcm/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h2 style="margin: 0">Better Blur</h2>
<p style="margin: 0">Version ${version}</p>

<p>
<b>Authors:</b><br>
KWin development team<br>
taj_ny
</p>
<p>
<a href="${repo}">GitHub</a><br>
<a href="${repo}/blob/main/docs/configuration.md">Configuration documentation</a>
</p>
8 changes: 8 additions & 0 deletions src/kcm/blur_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ BlurEffectConfig::BlurEffectConfig(QObject *parent, const KPluginMetaData &data)
ui.setupUi(widget());
BlurConfig::instance("kwinrc");
addConfig(BlurConfig::self(), widget());

QFile about(":/effects/forceblur/kcm/about.html");
if (about.open(QIODevice::ReadOnly)) {
const auto html = about.readAll()
.replace("${version}", ABOUT_VERSION_STRING)
.replace("${repo}", "https://github.com/taj-ny/kwin-effects-forceblur");
ui.aboutText->setHtml(html);
}
}

BlurEffectConfig::~BlurEffectConfig()
Expand Down
5 changes: 5 additions & 0 deletions src/kcm/blur_config.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/effects/forceblur/kcm/">
<file>about.html</file>
</qresource>
</RCC>
30 changes: 20 additions & 10 deletions src/kcm/blur_config.ui
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,26 @@ Works best with tiling.</string>
</item>
</layout>
</widget>
</widget>
</item>
<item alignment="Qt::AlignCenter">
<widget class="QLabel">
<property name="text">
<string>&lt;a href="https://github.com/taj-ny/kwin-effects-forceblur/blob/main/docs/configuration.md"&gt;Configuration documentation&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<widget class="QWidget">
<attribute name="title">
<string>About</string>
</attribute>
<layout class="QVBoxLayout">
<item>
<widget class="QTextBrowser" name="aboutText">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="text">
<string>Failed to load about.html</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
Expand Down

0 comments on commit 2052564

Please sign in to comment.