Wizard: fix small ui problems
This commit is contained in:
+4
-4
@@ -1,6 +1,6 @@
|
||||
generator.title=Kotlin (Experimental Wizard)
|
||||
|
||||
error.nothing.selected=No module is selected. Select module or source set to configure.
|
||||
error.nothing.selected=Select a module to configure
|
||||
project.preview=Project Structure
|
||||
|
||||
additional.buildsystem.settings.kotlin.runtime=Kotlin Runtime
|
||||
@@ -8,8 +8,8 @@ additional.buildsystem.settings.project.jdk=Project JDK
|
||||
additional.buildsystem.settings.artifact.coordinates=Artifact Coordinates
|
||||
|
||||
module.dependencies.module.dependencies=Module dependencies
|
||||
module.dependencies.add.module.dependency=Add a module Dependency
|
||||
module.dependencies.remove.module.dependency=Remove a module Dependency
|
||||
module.dependencies.add.module.dependency=Add a module dependency
|
||||
module.dependencies.remove.module.dependency=Remove a module dependency
|
||||
|
||||
editor.modules.add=Add {0}
|
||||
editor.modules.remove.selected.module=Do you want to remove {0} module with all submodules?
|
||||
@@ -25,7 +25,7 @@ editor.modules.no.modules=No modules created
|
||||
|
||||
module.settings.name=Name
|
||||
module.settings.name.same.as.project=<The same as the project name>
|
||||
module.settings.name.can.not.be.modified=<Can not be modified>
|
||||
module.settings.name.can.not.be.modified=<Cannot be modified>
|
||||
module.settings.name.module.name=Module name
|
||||
|
||||
module.settings.template=Template
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.tools.projectWizard.wizard.ui
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.ui.components.JBLabel
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import javax.swing.SwingConstants
|
||||
|
||||
class CommentLabel : JBLabel() {
|
||||
init {
|
||||
verticalAlignment = SwingConstants.TOP
|
||||
isFocusable = false
|
||||
foreground = UIUtil.getContextHelpForeground()
|
||||
|
||||
// taken from com.intellij.openapi.ui.panel.ComponentPanelBuilder.createCommentComponent
|
||||
if (SystemInfo.isMac) {
|
||||
val font = this.font
|
||||
val size = font.size2D
|
||||
val smallFont = font.deriveFont(size - 2.0f)
|
||||
this.font = smallFont
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-12
@@ -76,19 +76,8 @@ class ProjectTemplateSettingComponent(
|
||||
}
|
||||
|
||||
class TemplateDescriptionComponent : Component() {
|
||||
private val descriptionLabel = JBLabel().apply {
|
||||
private val descriptionLabel = CommentLabel().apply {
|
||||
preferredSize = Dimension(preferredSize.width, 45)
|
||||
verticalAlignment = SwingConstants.TOP
|
||||
isFocusable = false
|
||||
foreground = UIUtil.getContextHelpForeground()
|
||||
|
||||
// taken from com.intellij.openapi.ui.panel.ComponentPanelBuilder.createCommentComponent
|
||||
if (SystemInfo.isMac) {
|
||||
val font = this.font
|
||||
val size = font.size2D
|
||||
val smallFont = font.deriveFont(size - 2.0f)
|
||||
this.font = smallFont
|
||||
}
|
||||
}
|
||||
|
||||
fun setTemplate(template: ProjectTemplate) {
|
||||
|
||||
+7
-1
@@ -1,6 +1,8 @@
|
||||
package org.jetbrains.kotlin.tools.projectWizard.wizard.ui.secondStep
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionToolbarPosition
|
||||
import com.intellij.openapi.actionSystem.CommonShortcuts
|
||||
import com.intellij.openapi.keymap.KeymapUtil
|
||||
import com.intellij.openapi.ui.popup.PopupStep
|
||||
import com.intellij.openapi.ui.popup.util.BaseListPopupStep
|
||||
import com.intellij.ui.ColoredListCellRenderer
|
||||
@@ -110,13 +112,17 @@ private class ModuleDependenciesList(getDependencies: () -> List<Module>) : Abst
|
||||
appendText(KotlinNewProjectWizardUIBundle.message("module.settings.dependencies.empty"))
|
||||
appendSecondaryText(
|
||||
KotlinNewProjectWizardUIBundle.message("module.settings.dependencies.empty.suggest.add"),
|
||||
SimpleTextAttributes.LINK_ATTRIBUTES
|
||||
SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES
|
||||
) {
|
||||
AddModulesPopUp.create(
|
||||
getDependencies(),
|
||||
::addDependency
|
||||
).showInCenterOf(this@ModuleDependenciesList)
|
||||
}
|
||||
val shortcutText = KeymapUtil.getFirstKeyboardShortcutText(CommonShortcuts.getNewForDialogs())
|
||||
if (shortcutText.isNotEmpty()) {
|
||||
appendSecondaryText(" ($shortcutText)", SimpleTextAttributes.GRAYED_ATTRIBUTES, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -131,8 +131,7 @@ private class ModuleTemplateComponent(
|
||||
}.asSubComponent()
|
||||
|
||||
override val forceLabelCenteringOffset: Int? = 4
|
||||
private val templateDescriptionLabel = JBLabel().apply {
|
||||
foreground = UIUtil.getContextHelpForeground()
|
||||
private val templateDescriptionLabel = CommentLabel().apply {
|
||||
addBorder(JBUI.Borders.empty(2, 4))
|
||||
}
|
||||
|
||||
@@ -142,7 +141,7 @@ private class ModuleTemplateComponent(
|
||||
}
|
||||
|
||||
private fun changeTemplateDescription(template: Template?) {
|
||||
templateDescriptionLabel.text = template?.description
|
||||
templateDescriptionLabel.text = template?.description?.asHtml()
|
||||
templateDescriptionLabel.isVisible = template?.description != null
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ module.template.console.jvm.description=Simple "Hello World!" Kotlin/JVM applica
|
||||
|
||||
module.template.ktor.server.title=Ktor Server
|
||||
module.template.ktor.server.description=Configurable Ktor web server for building web applications
|
||||
module.template.ktor.server.setting.engine=Ktor Server Engine
|
||||
module.template.ktor.server.setting.engine=Ktor server engine
|
||||
module.template.ktor.server.setting.engine.netty=Netty
|
||||
module.template.ktor.server.setting.engine.tomcat=Tomcat
|
||||
module.template.ktor.server.setting.engine.jetty=Jetty
|
||||
|
||||
Reference in New Issue
Block a user