Skip to content

Commit 81e04ec

Browse files
authored
Make Theme.Monet able to export (#719)
1 parent e414817 commit 81e04ec

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

app/src/main/java/org/fcitx/fcitx5/android/data/theme/Theme.kt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,33 @@ sealed class Theme : Parcelable {
323323
genericActiveBackgroundColor = primary,
324324
genericActiveForegroundColor = onPrimary
325325
)
326+
327+
@OptIn(ExperimentalStdlibApi::class)
328+
fun toCustom() = Custom(
329+
name = name + "#" + this.accentKeyBackgroundColor.toHexString(), // Use primary color as identifier
330+
isDark = isDark,
331+
backgroundImage = null,
332+
backgroundColor = backgroundColor,
333+
barColor = barColor,
334+
keyboardColor = keyboardColor,
335+
keyBackgroundColor = keyBackgroundColor,
336+
keyTextColor = keyTextColor,
337+
candidateTextColor = candidateTextColor,
338+
candidateLabelColor = candidateLabelColor,
339+
candidateCommentColor = candidateCommentColor,
340+
altKeyBackgroundColor = altKeyBackgroundColor,
341+
altKeyTextColor = altKeyTextColor,
342+
accentKeyBackgroundColor = accentKeyBackgroundColor,
343+
accentKeyTextColor = accentKeyTextColor,
344+
keyPressHighlightColor = keyPressHighlightColor,
345+
keyShadowColor = keyShadowColor,
346+
popupBackgroundColor = popupBackgroundColor,
347+
popupTextColor = popupTextColor,
348+
spaceBarColor = spaceBarColor,
349+
dividerColor = dividerColor,
350+
clipboardEntryColor = clipboardEntryColor,
351+
genericActiveBackgroundColor = genericActiveBackgroundColor,
352+
genericActiveForegroundColor = genericActiveForegroundColor
353+
)
326354
}
327355
}

app/src/main/java/org/fcitx/fcitx5/android/ui/main/settings/theme/ThemeListAdapter.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ abstract class ThemeListAdapter : RecyclerView.Adapter<ThemeListAdapter.ViewHold
127127
if (theme is Theme.Custom) {
128128
onExportTheme(theme)
129129
true
130+
} else if (theme is Theme.Monet) {
131+
onExportTheme(theme.toCustom())
132+
true
130133
} else false
131134
}
132135
editButton.setOnClickListener {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy