Skip to content

Commit 0a4189b

Browse files
committed
Refactor QPWRadioButton and related components to remove isBackgroundEnable parameter for cleaner code
1 parent c99943f commit 0a4189b

5 files changed

Lines changed: 2 additions & 9 deletions

File tree

src/main/kotlin/com/github/cnrture/quickprojectwizard/common/Utils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ object Utils {
130130
sourceDir = sourceFile,
131131
targetModulePath = moduleName,
132132
packageName = finalPackageName,
133-
isMoveFiles = isMoveFiles
133+
isMoveFiles = true,
134134
)
135135
} else {
136136
val modulePath = File(project.basePath, moduleName.replace(":", "/"))

src/main/kotlin/com/github/cnrture/quickprojectwizard/components/QPWRadioButton.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import com.github.cnrture.quickprojectwizard.theme.QPWTheme
2828
fun QPWRadioButton(
2929
text: String,
3030
selected: Boolean,
31-
isBackgroundEnable: Boolean = false,
3231
color: Color = QPWTheme.colors.red,
3332
onClick: () -> Unit,
3433
) {
@@ -40,7 +39,7 @@ fun QPWRadioButton(
4039
onClick = onClick,
4140
)
4241
.then(
43-
if (isBackgroundEnable && selected) {
42+
if (selected) {
4443
Modifier.background(
4544
color = color,
4645
shape = RoundedCornerShape(12.dp)

src/main/kotlin/com/github/cnrture/quickprojectwizard/dialog/ModuleMakerDialogWrapper.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ class ModuleMakerDialogWrapper(
588588
QPWRadioButton(
589589
text = text,
590590
selected = text == moduleTypeSelectionState,
591-
isBackgroundEnable = true,
592591
color = QPWTheme.colors.red,
593592
onClick = { onModuleTypeSelected(text) },
594593
)

src/main/kotlin/com/github/cnrture/quickprojectwizard/dialog/SettingsDialogWrapper.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ class SettingsDialogWrapper() : QPWDialogWrapper(
164164
QPWRadioButton(
165165
text = Constants.ANDROID,
166166
selected = currentSettings.preferredModuleType == Constants.ANDROID,
167-
isBackgroundEnable = true,
168167
color = QPWTheme.colors.red,
169168
onClick = {
170169
currentSettings = currentSettings.copy(preferredModuleType = Constants.ANDROID)
@@ -176,7 +175,6 @@ class SettingsDialogWrapper() : QPWDialogWrapper(
176175
QPWRadioButton(
177176
text = Constants.KOTLIN,
178177
selected = currentSettings.preferredModuleType == Constants.KOTLIN,
179-
isBackgroundEnable = true,
180178
color = QPWTheme.colors.red,
181179
onClick = {
182180
currentSettings = currentSettings.copy(preferredModuleType = Constants.KOTLIN)
@@ -205,7 +203,6 @@ class SettingsDialogWrapper() : QPWDialogWrapper(
205203
QPWRadioButton(
206204
text = templateType,
207205
selected = selectedTemplateType == templateType,
208-
isBackgroundEnable = true,
209206
color = QPWTheme.colors.red,
210207
onClick = {
211208
selectedTemplateType = templateType
@@ -262,7 +259,6 @@ class SettingsDialogWrapper() : QPWDialogWrapper(
262259
QPWRadioButton(
263260
text = template,
264261
selected = selectedTemplateName == template,
265-
isBackgroundEnable = true,
266262
color = QPWTheme.colors.red,
267263
onClick = {
268264
selectedTemplateName = template

src/main/kotlin/com/github/cnrture/quickprojectwizard/toolwindow/manager/modulemaker/components/ModuleTypeNameContent.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ fun ModuleTypeNameContent(
5656
QPWRadioButton(
5757
text = text,
5858
selected = text == moduleTypeSelectionState,
59-
isBackgroundEnable = true,
6059
color = QPWTheme.colors.red,
6160
onClick = { onModuleTypeSelected(text) },
6261
)

0 commit comments

Comments
 (0)