Skip to content

Commit 79f74c2

Browse files
committed
COMPLETES hex converter
1 parent 3bad3ad commit 79f74c2

File tree

1 file changed

+53
-31
lines changed
  • tools/hex-converter/hex_converter

1 file changed

+53
-31
lines changed

tools/hex-converter/hex_converter/Main.qml

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ Window {
5555

5656
ScrollView {
5757
id: input_text_view
58+
anchors.fill: parent
59+
5860
TextArea {
5961
id: input_chars_field
62+
width: parent.width
63+
wrapMode: Text.WordWrap
6064
color: "black"
6165
font.family: "ubuntu"
6266
font.pixelSize: 23
@@ -168,7 +172,7 @@ Window {
168172

169173
/* Holds the input field label and the input field itself */
170174
RowLayout {
171-
Text { /* input field label */
175+
Text { /* output field label */
172176
horizontalAlignment: Text.AlignHCenter
173177
rightPadding: 35 // crude way to alight with the top field
174178
leftPadding: 10
@@ -178,20 +182,25 @@ Window {
178182
font.pixelSize: 20
179183
}
180184

181-
/* input text area */
185+
/* output text area */
182186
Rectangle {
183187
width: 500
184188
height: 100
185-
color: "#f3f3f3"
189+
color: "black"
186190
border.color: "black"
187191
border.width: 2
188192
radius: 2
189193

190194
ScrollView {
191195
id: output_text_view
196+
clip: true
197+
anchors.fill: parent
198+
192199
TextArea {
193200
id: output_chars_field
194-
color: "black"
201+
width: parent.width
202+
wrapMode: Text.WordWrap
203+
color: "#00d900"
195204
font.family: "ubuntu"
196205
font.pixelSize: 23
197206
placeholderText: "\n\n\n\n\n\n"
@@ -207,7 +216,21 @@ Window {
207216
font.family: "ubuntu"
208217
font.pixelSize: 23
209218

219+
onClicked: {
220+
output_chars_field.selectAll()
221+
output_chars_field.copy()
222+
223+
copy_button.text = "Copied"
224+
copy_button_text.color = "#00d55f"
225+
}
226+
227+
onFocusChanged: {
228+
copy_button.text = "Copy"
229+
copy_button_text.color = "#ffffff"
230+
}
231+
210232
contentItem: Text {
233+
id: copy_button_text
211234
text: copy_button.text
212235
font: copy_button.font
213236
opacity: enabled ? 1.0 : 0.3
@@ -230,32 +253,32 @@ Window {
230253
/* end of clear button */
231254

232255
/* Save to file button */
233-
Button{
234-
id: save_button
235-
text: qsTr("Save")
236-
font.family: "ubuntu"
237-
font.pixelSize: 23
238-
239-
contentItem: Text {
240-
text: save_button.text
241-
font: save_button.font
242-
opacity: enabled ? 1.0 : 0.3
243-
color: "#ffffff"
244-
horizontalAlignment: Text.AlignHCenter
245-
verticalAlignment: Text.AlignVCenter
246-
elide: Text.ElideRight
247-
}
248-
249-
background: Rectangle {
250-
implicitWidth: 100
251-
implicitHeight: 40
252-
opacity: enabled ? 1: 0.3
253-
border.color: save_button.down ? "#1c4d4d" : "#4d4d4d"
254-
color: "#636363"
255-
border.width: 2
256-
radius: 2
257-
}
258-
}
256+
// Button{
257+
// id: save_button
258+
// text: qsTr("Save")
259+
// font.family: "ubuntu"
260+
// font.pixelSize: 23
261+
262+
// contentItem: Text {
263+
// text: save_button.text
264+
// font: save_button.font
265+
// opacity: enabled ? 1.0 : 0.3
266+
// color: "#ffffff"
267+
// horizontalAlignment: Text.AlignHCenter
268+
// verticalAlignment: Text.AlignVCenter
269+
// elide: Text.ElideRight
270+
// }
271+
272+
// background: Rectangle {
273+
// implicitWidth: 100
274+
// implicitHeight: 40
275+
// opacity: enabled ? 1: 0.3
276+
// border.color: save_button.down ? "#1c4d4d" : "#4d4d4d"
277+
// color: "#636363"
278+
// border.width: 2
279+
// radius: 2
280+
// }
281+
// }
259282
/* end of convert button */
260283

261284
}
@@ -264,5 +287,4 @@ Window {
264287
}
265288

266289
}
267-
268290
}

0 commit comments

Comments
 (0)