forked from rojo-rbx/rojo
Switch assets to use custom rounded rectangle
This commit is contained in:
BIN
assets/round-rect-8px-radius-2px-border.png
Normal file
BIN
assets/round-rect-8px-radius-2px-border.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 513 B |
@@ -9,22 +9,10 @@ local Assets = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Slices = {
|
Slices = {
|
||||||
GrayBox = {
|
RoundBox = {
|
||||||
asset = sheetAsset,
|
asset = "rbxassetid://2754309674",
|
||||||
offset = Vector2.new(147, 433),
|
offset = Vector2.new(0, 0),
|
||||||
size = Vector2.new(38, 36),
|
size = Vector2.new(0, 0),
|
||||||
center = Rect.new(8, 8, 9, 9),
|
|
||||||
},
|
|
||||||
GrayButton02 = {
|
|
||||||
asset = sheetAsset,
|
|
||||||
offset = Vector2.new(0, 98),
|
|
||||||
size = Vector2.new(190, 45),
|
|
||||||
center = Rect.new(16, 16, 17, 17),
|
|
||||||
},
|
|
||||||
GrayButton07 = {
|
|
||||||
asset = sheetAsset,
|
|
||||||
offset = Vector2.new(195, 0),
|
|
||||||
size = Vector2.new(49, 49),
|
|
||||||
center = Rect.new(16, 16, 17, 17),
|
center = Rect.new(16, 16, 17, 17),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ local FormButton = require(Plugin.Components.FormButton)
|
|||||||
local FormTextInput = require(Plugin.Components.FormTextInput)
|
local FormTextInput = require(Plugin.Components.FormTextInput)
|
||||||
|
|
||||||
local WhiteCross = Assets.Sprites.WhiteCross
|
local WhiteCross = Assets.Sprites.WhiteCross
|
||||||
local GrayBox = Assets.Slices.GrayBox
|
local RoundBox = Assets.Slices.RoundBox
|
||||||
|
|
||||||
local e = Roact.createElement
|
local e = Roact.createElement
|
||||||
|
|
||||||
@@ -52,11 +52,11 @@ function ConnectPanel:render()
|
|||||||
return e(FitList, {
|
return e(FitList, {
|
||||||
containerKind = "ImageLabel",
|
containerKind = "ImageLabel",
|
||||||
containerProps = {
|
containerProps = {
|
||||||
Image = GrayBox.asset,
|
Image = RoundBox.asset,
|
||||||
ImageRectOffset = GrayBox.offset,
|
ImageRectOffset = RoundBox.offset,
|
||||||
ImageRectSize = GrayBox.size,
|
ImageRectSize = RoundBox.size,
|
||||||
|
SliceCenter = RoundBox.center,
|
||||||
ScaleType = Enum.ScaleType.Slice,
|
ScaleType = Enum.ScaleType.Slice,
|
||||||
SliceCenter = GrayBox.center,
|
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Position = UDim2.new(0.5, 0, 0.5, 0),
|
Position = UDim2.new(0.5, 0, 0.5, 0),
|
||||||
AnchorPoint = Vector2.new(0.5, 0.5),
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
||||||
@@ -135,7 +135,7 @@ function ConnectPanel:render()
|
|||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
Label = e(FitText, {
|
Label = e(FitText, {
|
||||||
MinSize = Vector2.new(0, 24),
|
MinSize = Vector2.new(0, 28),
|
||||||
Kind = "TextLabel",
|
Kind = "TextLabel",
|
||||||
LayoutOrder = 1,
|
LayoutOrder = 1,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
@@ -156,7 +156,7 @@ function ConnectPanel:render()
|
|||||||
|
|
||||||
Input = e(FormTextInput, {
|
Input = e(FormTextInput, {
|
||||||
layoutOrder = 2,
|
layoutOrder = 2,
|
||||||
size = UDim2.new(0, 300, 0, 24),
|
size = UDim2.new(0, 300, 0, 28),
|
||||||
value = self.state.address,
|
value = self.state.address,
|
||||||
onValueChange = function(newValue)
|
onValueChange = function(newValue)
|
||||||
self:setState({
|
self:setState({
|
||||||
@@ -177,7 +177,7 @@ function ConnectPanel:render()
|
|||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
Label = e(FitText, {
|
Label = e(FitText, {
|
||||||
MinSize = Vector2.new(0, 24),
|
MinSize = Vector2.new(0, 28),
|
||||||
Kind = "TextLabel",
|
Kind = "TextLabel",
|
||||||
LayoutOrder = 1,
|
LayoutOrder = 1,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
@@ -198,7 +198,7 @@ function ConnectPanel:render()
|
|||||||
|
|
||||||
Input = e(FormTextInput, {
|
Input = e(FormTextInput, {
|
||||||
layoutOrder = 2,
|
layoutOrder = 2,
|
||||||
size = UDim2.new(0, 300, 0, 24),
|
size = UDim2.new(0, 300, 0, 28),
|
||||||
value = self.state.port,
|
value = self.state.port,
|
||||||
onValueChange = function(newValue)
|
onValueChange = function(newValue)
|
||||||
self:setState({
|
self:setState({
|
||||||
@@ -234,6 +234,7 @@ function ConnectPanel:render()
|
|||||||
cancel()
|
cancel()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
secondary = true,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local FitText = require(script.Parent.FitText)
|
|||||||
|
|
||||||
local e = Roact.createElement
|
local e = Roact.createElement
|
||||||
|
|
||||||
local GrayBox = Assets.Slices.GrayBox
|
local RoundBox = Assets.Slices.RoundBox
|
||||||
|
|
||||||
local ConnectionActivePanel = Roact.Component:extend("ConnectionActivePanel")
|
local ConnectionActivePanel = Roact.Component:extend("ConnectionActivePanel")
|
||||||
|
|
||||||
@@ -15,10 +15,10 @@ function ConnectionActivePanel:render()
|
|||||||
return e(FitList, {
|
return e(FitList, {
|
||||||
containerKind = "ImageButton",
|
containerKind = "ImageButton",
|
||||||
containerProps = {
|
containerProps = {
|
||||||
Image = GrayBox.asset,
|
Image = RoundBox.asset,
|
||||||
ImageRectOffset = GrayBox.offset,
|
ImageRectOffset = RoundBox.offset,
|
||||||
ImageRectSize = GrayBox.size,
|
ImageRectSize = RoundBox.size,
|
||||||
SliceCenter = GrayBox.center,
|
SliceCenter = RoundBox.center,
|
||||||
ScaleType = Enum.ScaleType.Slice,
|
ScaleType = Enum.ScaleType.Slice,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Position = UDim2.new(0.5, 0, 0, 0),
|
Position = UDim2.new(0.5, 0, 0, 0),
|
||||||
|
|||||||
@@ -9,23 +9,26 @@ local FitText = require(Plugin.Components.FitText)
|
|||||||
|
|
||||||
local e = Roact.createElement
|
local e = Roact.createElement
|
||||||
|
|
||||||
local GrayButton07 = Assets.Slices.GrayButton07
|
local RoundBox = Assets.Slices.RoundBox
|
||||||
|
|
||||||
local function FormButton(props)
|
local function FormButton(props)
|
||||||
local text = props.text
|
local text = props.text
|
||||||
local layoutOrder = props.layoutOrder
|
local layoutOrder = props.layoutOrder
|
||||||
local onClick = props.onClick
|
local onClick = props.onClick
|
||||||
|
|
||||||
|
local imageColor = props.secondary and Color3.new(0.95, 0.95, 0.95) or nil
|
||||||
|
|
||||||
return e(FitList, {
|
return e(FitList, {
|
||||||
containerKind = "ImageButton",
|
containerKind = "ImageButton",
|
||||||
containerProps = {
|
containerProps = {
|
||||||
LayoutOrder = layoutOrder,
|
LayoutOrder = layoutOrder,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = GrayButton07.asset,
|
Image = RoundBox.asset,
|
||||||
ImageRectOffset = GrayButton07.offset,
|
ImageRectOffset = RoundBox.offset,
|
||||||
ImageRectSize = GrayButton07.size,
|
ImageRectSize = RoundBox.size,
|
||||||
|
SliceCenter = RoundBox.center,
|
||||||
ScaleType = Enum.ScaleType.Slice,
|
ScaleType = Enum.ScaleType.Slice,
|
||||||
SliceCenter = GrayButton07.center,
|
ImageColor3 = imageColor,
|
||||||
|
|
||||||
[Roact.Event.Activated] = function()
|
[Roact.Event.Activated] = function()
|
||||||
if onClick ~= nil then
|
if onClick ~= nil then
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local Assets = require(Plugin.Assets)
|
|||||||
|
|
||||||
local e = Roact.createElement
|
local e = Roact.createElement
|
||||||
|
|
||||||
local GrayBox = Assets.Slices.GrayBox
|
local RoundBox = Assets.Slices.RoundBox
|
||||||
|
|
||||||
local function FormTextInput(props)
|
local function FormTextInput(props)
|
||||||
local value = props.value
|
local value = props.value
|
||||||
@@ -17,17 +17,18 @@ local function FormTextInput(props)
|
|||||||
|
|
||||||
return e("ImageLabel", {
|
return e("ImageLabel", {
|
||||||
LayoutOrder = layoutOrder,
|
LayoutOrder = layoutOrder,
|
||||||
Image = GrayBox.asset,
|
Image = RoundBox.asset,
|
||||||
ImageRectOffset = GrayBox.offset,
|
ImageRectOffset = RoundBox.offset,
|
||||||
ImageRectSize = GrayBox.size,
|
ImageRectSize = RoundBox.size,
|
||||||
ScaleType = Enum.ScaleType.Slice,
|
ScaleType = Enum.ScaleType.Slice,
|
||||||
SliceCenter = GrayBox.center,
|
SliceCenter = RoundBox.center,
|
||||||
|
ImageColor3 = Color3.new(0.95, 0.95, 0.95),
|
||||||
Size = size,
|
Size = size,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
}, {
|
}, {
|
||||||
InputInner = e("TextBox", {
|
InputInner = e("TextBox", {
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Size = UDim2.new(1, -8, 1, -8),
|
Size = UDim2.new(1, -12, 1, -12),
|
||||||
Position = UDim2.new(0.5, 0, 0.5, 0),
|
Position = UDim2.new(0.5, 0, 0.5, 0),
|
||||||
AnchorPoint = Vector2.new(0.5, 0.5),
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
||||||
Font = Enum.Font.SourceSans,
|
Font = Enum.Font.SourceSans,
|
||||||
|
|||||||
Reference in New Issue
Block a user