wiview.qml 53.6 KB
Newer Older
1

2
// Copyright (C) 2013 Samikshan Bairagya <samikshan@gmail.com>
3 4
/***************************************************************************
 *                                                                         *
5 6 7 8 9 10 11 12 13
  *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
    *   the Free Software Foundation; either version 2 of the License, or     *
     *   (at your option) any later version.                                   *
      *                                                                         *
       ***************************************************************************/
import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
14 15 16 17

Rectangle {
    id: container
    objectName: "containerObj"
18
    color: "#020518"
19 20
    anchors.fill: parent

21 22 23
    property double buttonOpacity: 0.2
    property double categoryTitleOpacity: 0.350

24 25 26 27 28
    Text {
        id: title
        x: 9
        y: 34
        color: "#59ad0e"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
29
        text: xi18n("What's Interesting...")
30
        verticalAlignment: Text.AlignVCenter
31 32 33 34 35
        font {
            family: "Cantarell"
            bold: false
            pixelSize:22
        }
36 37
    }

38
    Item {
39
        id: base
40
        y: 89
41
        width: parent.width
42
        height: parent.height
43 44 45 46 47 48 49
        anchors {
            left: parent.left
            leftMargin: 0
            right: parent.right
            rightMargin: 0
        }

50 51 52 53
        Item {
            id: viewsRow
            objectName: "viewsRowObj"
            width: parent.width
54 55 56 57
            anchors {
                top: parent.top
                bottom: parent.bottom
            }
58 59 60

            signal categorySelected(int category)

61
            Item {
62
                id: categoryView
63 64
                x: 0
                y: 31
65
                width: parent.width
66 67 68 69 70 71 72
                height: 351

                Rectangle {
                    id: background

                    color: "#00060b"
                    radius: 12
73 74 75 76 77 78 79 80 81 82 83
                    anchors {
                        top: parent.top
                        topMargin: 15
                        bottom: parent.bottom
                        bottomMargin: 13
                        right: parent.right
                        rightMargin: 20
                        left: parent.left
                        leftMargin: 20
                    }

84
                    opacity: 0.500
85 86 87 88
                    border {
                        width: 4
                        color: "black"
                    }
89
                }
90

91 92
                Item {
                    id: planetItem
93 94
                    width: planetText.width
                    height: planetText.height
95 96 97 98 99
                    anchors{
                        verticalCenterOffset: -130
                        horizontalCenterOffset: -30
                        centerIn: parent
                    }
100

101
                    CategoryTitle {
102
                        id: planetText
103 104 105

                        title: xi18n("Planets")
                        anchors.centerIn: parent
106 107 108 109 110

                        MouseArea {
                            id: planetMouseArea
                            anchors.fill: parent
                            hoverEnabled: true
111
                            onEntered: container.state = "planetAreaEntered"
112 113
                            onClicked: {
                                viewsRow.categorySelected(0)
114
                                container.state = "soTypeSelected"
115 116 117
                            }
                        }
                    }
118
                }
119

120 121 122
                Item {
                    id: starItem

123 124
                    width: starText.width
                    height: starText.height
125 126 127 128 129
                    anchors{
                        verticalCenterOffset: -85
                        horizontalCenterOffset: 87
                        centerIn: parent
                    }
130

131
                    CategoryTitle {
132
                        id: starText
133 134 135

                        title: xi18n("Stars")
                        anchors.centerIn: parent
136 137 138 139

                        MouseArea {
                            id: starMouseArea
                            hoverEnabled: true
140 141
                            anchors.fill: parent
                            onEntered: container.state = "starAreaEntered"
142 143
                            onClicked: {
                                viewsRow.categorySelected(1)
144
                                container.state = "soTypeSelected"
145 146 147
                            }
                        }
                    }
148
                }
149

150 151
                Item {
                    id: conItem
152 153
                    width: conText.width
                    height: conText.height
154 155 156 157 158
                    anchors {
                        verticalCenterOffset: -52
                        horizontalCenterOffset: -63
                        centerIn: parent
                    }
159

160
                    CategoryTitle {
161
                        id: conText
162 163
                        title: xi18n("Constellations")
                        anchors.centerIn: parent
164 165 166 167 168

                        MouseArea {
                            id: conMouseArea
                            anchors.fill: parent
                            hoverEnabled: true
169
                            onEntered: container.state = "conAreaEntered"
170 171
                            onClicked: {
                                viewsRow.categorySelected(2)
172
                                container.state = "soTypeSelected"
173
                            }
174 175 176 177
                        }
                    }
                }

178
                Item {
179 180 181
                    id: dsoContainer
                    y: 172
                    height: 166
182 183 184 185 186 187
                    anchors {
                        right: parent.right
                        rightMargin: 35
                        left: parent.left
                        leftMargin: 35
                    }
188

189 190
                    Item {
                        id: dsoItem
191 192
                        width: dsoText.width
                        height: dsoText.height
193 194 195 196 197 198 199 200

                        anchors {
                            verticalCenterOffset: -54
                            horizontalCenterOffset: 0
                            centerIn: parent
                        }

                        CategoryTitle {
201
                            id: dsoText
202 203 204 205

                            title: xi18n("Deep-sky Objects")
                            anchors.centerIn: parent

206 207 208 209 210 211 212
                            MouseArea {
                                id: dsoMouseArea
                                hoverEnabled: true
                                anchors.fill: parent
                                onEntered: container.state = "dsoAreaEntered"
                                onClicked: container.state = "dsoAreaClicked"
                            }
213 214 215
                        }
                    }

216 217 218
                    Item {
                        id: galItem

219 220
                        width: galText.width
                        height: galText.height
221 222 223 224 225 226 227 228 229

                        anchors {
                            verticalCenterOffset: -4
                            horizontalCenterOffset: -77
                            centerIn: parent
                        }
                        opacity: categoryTitleOpacity

                        CategoryTitle {
230
                            id: galText
231 232 233 234 235 236 237
                            color: disabledColor
                            title: xi18n("Galaxies")
                            anchors {
                                centerIn: parent
                                margins: 0
                            }

238 239 240 241 242 243
                            MouseArea {
                                id: galMouseArea
                                enabled: false
                                hoverEnabled: false
                                anchors.fill: parent
                                onEntered: container.state = "galAreaEntered"
244 245
                                onClicked: {
                                    viewsRow.categorySelected(3)
246
                                    container.state = "dsoTypeSelected"
247
                                }
248
                            }
249 250 251
                        }
                    }

252 253 254
                    Item {
                        id: nebItem

255 256
                        width: nebText.width
                        height: nebText.height
257 258 259 260 261 262

                        anchors {
                            verticalCenterOffset: 52
                            horizontalCenterOffset: -17
                            centerIn: parent
                        }
263
                        opacity: 0.340
264 265

                        CategoryTitle {
266
                            id: nebText
267 268 269 270
                            color: disabledColor
                            title: xi18n("Nebulae")
                            anchors.centerIn: parent

271 272 273 274 275 276
                            MouseArea {
                                id: nebMouseArea
                                enabled: false
                                hoverEnabled: false
                                anchors.fill: parent
                                onEntered: container.state = "nebAreaEntered"
277 278
                                onClicked: {
                                    viewsRow.categorySelected(5)
279
                                    container.state = "dsoTypeSelected"
280
                                }
281
                            }
282 283 284
                        }
                    }

285 286 287
                    Item {
                        id: clustItem

288 289
                        width: clustText.width
                        height: clustText.height
290 291 292 293 294 295 296 297 298

                        anchors {
                            verticalCenterOffset: 8
                            horizontalCenterOffset: 69
                            centerIn: parent
                        }
                        opacity: categoryTitleOpacity

                        CategoryTitle {
299
                            id: clustText
300 301 302 303
                            color: disabledColor
                            title: xi18n("Clusters")
                            anchors.centerIn: parent

304 305 306 307 308 309
                            MouseArea {
                                id: clustMouseArea
                                enabled: false
                                hoverEnabled: false
                                anchors.fill: parent
                                onEntered: container.state = "clustAreaEntered"
310 311
                                onClicked: {
                                    viewsRow.categorySelected(4)
312
                                    container.state = "dsoTypeSelected"
313
                                }
314
                            }
315 316 317
                        }
                    }
                }
318
            } //end of categoryView
319 320 321 322

            Flipable {
                id: skyObjView
                width: parent.width
323
                height: parent.height - 150
324
                anchors.leftMargin: categoryView.width
325 326 327
                anchors.left: categoryView.right
                property bool flipped: false

328
                front: Item {
329
                    id: soListContainer
330
                    anchors.fill: parent
331
                    enabled: !parent.flipped // To hide content of front side on back side
332

333 334 335 336 337
                    Rectangle {
                        id: soListViewBackground
                        anchors.fill: soListViewContainer
                        color: "#00060b"
                        opacity: 0.5
338
                        radius: 12
339 340
                    }

341 342 343 344 345
                    Rectangle {
                        id: soListViewContainer
                        x: parent.x + 15
                        y: 31
                        width: parent.width - 30
346
                        height: parent.height -30
347
                        color: "transparent"
348
                        radius: 12
349 350 351 352
                        border {
                            width: 4
                            color: "#000000"
                        }
353 354 355

                        ListView {
                            id: soListView
356
                            z: 0
357 358
                            objectName: "soListObj"
                            anchors.fill: parent
359

360
                            signal soListItemClicked(int type, string typeName, int curIndex)
361 362
                            clip: true

363 364 365
                            ScrollView {
                                anchors.fill: parent
                                contentItem: soListView
366 367
                            }

368 369
                            delegate: Item {
                                id: soListItem
370
                                x: 8
371
                                width: parent.width
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
                                height: (dispSummary.height >= 130) ? dispSummary.height + 20 : 160         
 
                                Rectangle{
                                	id: summaryBackground
                                	color: "transparent"
                                	width: parent.width
    								height: parent.height
									Text {
										id: dispSummary
										objectName: dispObjSummary
										text: dispObjSummary
										x: image.width + 5
										width: parent.width - image.width - 30
										color: "#187988"
	   
										wrapMode: Text.WrapAtWordBoundaryOrAnywhere
										font{
											family: "Cantarell"
											pixelSize: 13
										}
									}
                                }
394 395 396 397 398 399 400
                                Image { 
                                	id: image
                                	width: 150
                                	fillMode: Image.PreserveAspectFit
                                	source: imageSource 
                                }

401 402 403 404
                                Text {
                                    id: dispText
                                    objectName: dispName
                                    text: dispName
405
                                    color: "white"
406

407
                                    font.bold: true
408 409
                                }
                                MouseArea {
410
                                        anchors.fill: parent
411
                                        hoverEnabled: true
412 413 414 415 416 417 418 419 420 421
                                        onEntered:{ 
                                        	dispText.color = "yellow"
                                        	dispSummary.color = "yellow"
                                        	summaryBackground.color = "#030723"
                                    	}
                                        onExited: {
                                        	dispText.color = "white"
                                        	dispSummary.color = "#187988"
                                        	summaryBackground.color ="transparent"
                                        }
422 423
                                        onClicked: {
                                            soListView.currentIndex = index
424 425 426
                                            soListView.soListItemClicked(
                                                        type, typeName,
                                                        soListView.currentIndex)
427 428
                                            skyObjView.flipped = true
                                        }
429
                            	}
430 431
                            }

432 433
                            model: soListModel
                        }
434 435 436
                    }
                }

437
                back: Item {
438
                    id: detailsViewContainer
439
                    width: parent.width
440
                    height: parent.height
441
                    enabled: parent.flipped
442

443

444 445
                    Rectangle {
                        id: detailsViewBackground
446
                        anchors.fill: detailsView
447
                        color: "#00060b"
448 449
                        radius: 12
                        opacity: 0.500
450 451
                    }

452 453 454 455
                    Rectangle {
                        id: detailsView
                        objectName: "detailsViewObj"
                        x: parent.x + 15
456
                        height: parent.height
457
                        width: parent.width - 30
458
                        color: "transparent"
459
                        radius: 12
460 461 462 463
                        border {
                            width: 4
                            color: "#000000"
                        }
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
                        
                        Image { 
                             id: detailImg 
                             height: 300
                             width:parent.width - 200
                             anchors{
                                right: parent.right
                             }
                             objectName: "detailImage"
                             property string refreshableSource
                             fillMode: Image.PreserveAspectFit
                             source: refreshableSource
                        }


479 480 481 482

                        Text {
                            id: soname
                            objectName: "sonameObj"
483
                            y: 8
484
                            width: parent.width
485
                            height: 22
486
                            color: "#ffffff"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
487
                            text: xi18n("text")
488 489 490 491 492 493 494 495
                            anchors{
                                left: parent.left
                                leftMargin: 8
                            }
                            font{
                                bold: true
                                pixelSize: 16
                            }
496
                            verticalAlignment: Text.AlignVCenter
497
                        }
498
                           
499 500 501
                        Text {
                            id: posText
                            objectName: "posTextObj"
502
                            y: 300
503 504 505 506
                            anchors{
                                right: parent.right
                                rightMargin: 10
                            }
507
                            width: parent.width
508
                            height: 16
509
                            color: "#f7f7ac"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
510
                            text: xi18n("text")
511
                            horizontalAlignment: Text.AlignRight
512 513 514 515 516 517
                            font{
                                family: "Cantarell"
                                bold: true
                                pixelSize:11
                            }

518
                        }
519

520
                        Rectangle {
521
                            id: descTextBox
522
                            y: 347
523
                            height: 200
524
                            color: "#010a14"
525
                            radius: 10
526
                            border.width: 0
527 528 529 530 531 532
                            anchors{
                                right: parent.right
                                rightMargin: 4
                                left: parent.left
                                leftMargin: 4
                            }
533
                            border.color: "#585454"
534

535
                            Flickable {
536
                                id: flickableDescText
537 538 539 540
                                clip: true
                                flickableDirection: Flickable.VerticalFlick
                                width: parent.width
                                height: parent.height
541 542 543 544 545 546
                                anchors{
                                    top: parent.top
                                    topMargin: 3
                                    bottom: parent.bottom
                                    bottomMargin: 4
                                }
547

548
                                contentWidth: parent.width
549
                                contentHeight: col.height + 4
550

551 552
                                Item {
                                    id: descTextItem
553 554 555 556 557 558 559
                                    anchors{
                                        top: parent.top
                                        topMargin: 3
                                        left: parent.left
                                        leftMargin: 6
                                        right: parent.right
                                    }
560 561
                                    Column {
                                        id: col
562
                                        width: parent.width
563 564 565 566
                                        Text {
                                            id: descText
                                            objectName: "descTextObj"
                                            color: "#187988"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
567
                                            text: xi18n("text")
568 569 570
                                            clip: true
                                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                                            width: parent.width
571 572 573 574
                                            font{
                                                family: "Cantarell"
                                                pixelSize: 13
                                            }
575
                                        }
576 577 578 579
                                        Text {
                                            id: descSrcText
                                            objectName: "descSrcTextObj"
                                            color: "#18885f"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
580
                                            text: xi18n("Source: ")
581
                                            clip: true
582
                                            horizontalAlignment: Text.AlignRight
583 584
                                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                                            width: parent.width
Vijay Dhameliya's avatar
Vijay Dhameliya committed
585
                                            onLinkActivated: Qt.openUrlExternally(link)
586 587 588 589 590
                                            font{
                                                family: "Cantarell"
                                                pixelSize: 13
                                                italic: true
                                            }
591
                                        }
592
                                    }
593 594 595 596
                                }
                            }
                        }

597
                        Item {
598 599
                            id: nextObjRect
                            objectName: "nextObj"
600
                            width: nextObjText.width + nextObjIcon.width + 10
601
                            height: 28
602 603 604 605 606 607
                            anchors {
                                right: parent.right
                                rightMargin: 10
                                bottom: parent.bottom
                                bottomMargin: 10
                            }
608

609
                            signal nextObjClicked
610 611 612 613

                            Rectangle {
                                id: nextObjForeground
                                radius: 5
614
                                anchors.fill: parent
615 616 617 618 619
                                opacity: 0
                            }

                            MouseArea {
                                id: nextObjMouseArea
620

621
                                anchors.fill: nextObjRect
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
                                hoverEnabled: true
                                onEntered: {
                                    nextObjForeground.opacity = 0.1
                                    nextObjText.color = "yellow"
                                }
                                onExited: {
                                    nextObjForeground.opacity = 0.0
                                    nextObjText.color = "white"
                                }
                                onClicked: nextObjRect.nextObjClicked()
                            }

                            Text {
                                id: nextObjText
                                objectName: "nextTextObj"
637

638 639
                                height: 22
                                color: "white"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
640
                                text: xi18n("Next")
641 642 643 644 645
                                anchors{
                                    right: nextObjIcon.left
                                    rightMargin: 5
                                    verticalCenter: parent.verticalCenter
                                }
646 647 648
                                visible: true
                                verticalAlignment: Text.AlignVCenter
                                horizontalAlignment: Text.AlignRight
649 650 651 652
                                font{
                                    bold: true
                                    pixelSize:11
                                }
653 654 655 656
                            }

                            Image {
                                id: nextObjIcon
657 658 659 660 661 662 663 664 665

                                anchors{
                                    right: parent.right
                                    verticalCenter: parent.verticalCenter
                                }
                                sourceSize {
                                    height: 24
                                    width: 24
                                }
666 667 668 669
                                source: "next.png"
                            }
                        }

670
                        Item {
671 672
                            id: prevObjRect
                            objectName: "prevObj"
673 674

                            width: prevObjText.width + prevObjIcon.width + 10
675
                            height: 28
676 677 678 679 680 681
                            anchors {
                                left: parent.left
                                leftMargin: 10
                                bottom: parent.bottom
                                bottomMargin: 10
                            }
682

683
                            signal prevObjClicked
684 685 686 687

                            Rectangle {
                                id: prevObjForeground
                                radius: 5
688
                                anchors.fill: parent
689 690 691 692 693
                                opacity: 0
                            }

                            MouseArea {
                                id: prevObjMouseArea
694
                                anchors.fill: parent
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709
                                hoverEnabled: true
                                onEntered: {
                                    prevObjForeground.opacity = 0.1
                                    prevObjText.color = "yellow"
                                }
                                onExited: {
                                    prevObjForeground.opacity = 0.0
                                    prevObjText.color = "white"
                                }
                                onClicked: prevObjRect.prevObjClicked()
                            }

                            Text {
                                id: prevObjText
                                objectName: "prevTextObj"
710

711 712
                                height: 22
                                color: "#ffffff"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
713
                                text: xi18n("Previous")
714 715 716 717 718
                                anchors{
                                    left: prevObjIcon.right
                                    leftMargin: 5
                                    verticalCenter: parent.verticalCenter
                                }
719 720 721
                                visible: true
                                horizontalAlignment: Text.AlignLeft
                                verticalAlignment: Text.AlignVCenter
722 723 724 725
                                font{
                                    pixelSize: 11
                                    bold: true
                                }
726 727 728 729 730
                            }

                            Image {
                                id: prevObjIcon
                                anchors.verticalCenter: parent.verticalCenter
731 732 733 734
                                sourceSize{
                                    height: 24
                                    width: 24
                                }
735 736 737
                                source: "previous.png"
                            }
                        }
738

739 740 741
                        Column {
                            id: detailItemsCol
                            x: 0
742 743
                            y: 100
                            width: parent.width
744 745
                            height: 93
                            spacing: 14
746
                            
747
                            DetailsItem {
748 749 750
                                id: detailsText
                                objectName: "detailsTextObj"
                                
751 752
                            }

753 754
                        }

755 756
                        Column {
                            id: detailsViewButtonsCol
757 758 759 760
                            y: 200
                            anchors {
                                left: parent.left
                                leftMargin: 10
761
                            }
762
                            
763
                            spacing: 14
764

765 766 767
                            Text {
                                id: detailsButton
                                objectName: "detailsButtonObj"
768

769 770
                                verticalAlignment: Text.AlignVCenter
                                color: "white"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
771
                                text: xi18n("More object details")
772 773 774 775 776
                                font {
                                    underline: true
                                    family: "Cantarell"
                                    pixelSize: 14
                                }
777

778
                                signal detailsButtonClicked
779 780 781 782

                                MouseArea {
                                    id: detailsMouseArea
                                    hoverEnabled: true
783
                                    cursorShape: Qt.PointingHandCursor
784 785 786 787 788
                                    anchors.fill: parent
                                    onEntered: detailsButton.color = "yellow"
                                    onExited: detailsButton.color = "white"
                                    onClicked: detailsButton.detailsButtonClicked()
                                }
789 790
                            }

791 792 793
                            Text {
                                id: slewButton
                                objectName: "slewButtonObj"
794 795

                                verticalAlignment: Text.AlignVCenter
796
                                color: "white"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
797
                                text: xi18n("Slew map to object")
798 799 800 801 802
                                font {
                                    underline: true
                                    family: "Cantarell"
                                    pixelSize: 14
                                }
803

804
                                signal slewButtonClicked
805

806 807 808
                                MouseArea {
                                    id: slewObjMouseArea
                                    hoverEnabled: true
809
                                    cursorShape: Qt.PointingHandCursor
810 811 812 813 814
                                    anchors.fill: parent
                                    onEntered: slewButton.color = "yellow"
                                    onExited: slewButton.color = "white"
                                    onClicked: slewButton.slewButtonClicked()
                                }
815
                            }
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841
                            
                            Text {
                                id: slewTelescopeButton
                                objectName: "slewTelescopeButtonObj"

                                verticalAlignment: Text.AlignVCenter
                                color: "white"
                                text: xi18n("Slew telescope to object")
                                font {
                                    underline: true
                                    family: "Cantarell"
                                    pixelSize: 14
                                }

                                signal slewTelescopeButtonClicked

                                MouseArea {
                                    id: slewTelescopeObjMouseArea
                                    hoverEnabled: true
                                    cursorShape: Qt.PointingHandCursor
                                    anchors.fill: parent
                                    onEntered: slewTelescopeButton.color = "yellow"
                                    onExited: slewTelescopeButton.color = "white"
                                    onClicked: slewTelescopeButton.slewTelescopeButtonClicked()
                                }
                            }
842
                        }
843 844
                    } //end of detailsView
                } //end of detailsViewContainer
845 846 847 848 849 850 851 852

                states: [
                    State {
                        name: "back"
                        PropertyChanges {
                            target: listToDetailsRotation
                            angle: 180
                        }
853 854 855 856 857 858 859 860

                        PropertyChanges {
                            target: settingsMouseArea
                            enabled: false
                        }

                        PropertyChanges {
                            target: settingsIcon
861
                            opacity: 0
862
                        }
863 864 865 866 867 868 869 870

                        PropertyChanges {
                            target: reloadMouseArea
                            enabled: false
                        }

                        PropertyChanges {
                            target: reloadIcon
871
                            opacity: 0
872 873
                        }

874 875 876 877 878 879
                        when: skyObjView.flipped
                    }
                ]

                transitions: [
                    Transition {
880 881 882 883 884
                        NumberAnimation {
                            target: listToDetailsRotation
                            property: "angle"
                            duration: 400
                        }
885 886 887 888 889
                    }
                ]

                transform: Rotation {
                    id: listToDetailsRotation
890 891 892
                    origin.x: container.width / 2
                    axis.y: 1
                    axis.z: 0
893
                }
894
            } //end of skyObjView
895 896
        } //end of viewsContainer
    } //end of base
897

898
    Rectangle {
899 900
        id: backButton
        x: container.width + 10
901
        y: container.height - 50
902
        width: leftArrow.width + goBackText.width + 18
903 904 905
        height: 49
        color: "#00000000"
        radius: 5
906 907 908 909 910 911 912 913

        Rectangle {
            id: goBackForeground
            anchors.fill: parent
            radius: 5
            opacity: 0.0
        }

914 915
        Text {
            id: goBackText
916
            y: 12
917
            color: "#f7e808"
Jasem Mutlaq's avatar
Jasem Mutlaq committed
918
            text: xi18n("Back")
919 920 921 922 923 924 925 926 927 928
            anchors {
                left: leftArrow.right
                leftMargin: 7
                verticalCenterOffset: 0
                verticalCenter: leftArrow.verticalCenter
            }
            font{
                family: "Cantarell"
                pointSize: 13
            }
929 930 931 932 933 934
            verticalAlignment: Text.AlignVCenter
            horizontalAlignment: Text.AlignHCenter
        }

        Image {
            id: leftArrow
935
            y: 9
936 937 938 939 940 941
            anchors{
                left: parent.left
                leftMargin: 4
                verticalCenterOffset: 0
                verticalCenter: parent.verticalCenter
            }
942 943 944 945
            source: "leftArrow.png"
        }

        MouseArea {
946
            id: backButtonMouseArea
947
            anchors.fill: backButton
948
            hoverEnabled: true
949
            onEntered: goBackForeground.opacity = buttonOpacity
950
            onExited: goBackForeground.opacity = 0.0
951
            onClicked: {
952 953
                if (container.state == "soTypeSelected") {
                    if (!skyObjView.flipped) {
954
                        container.state = "base"
955
                    } else if (skyObjView.flipped) {
956 957
                        skyObjView.flipped = false
                    }
958 959
                } else if (container.state == "dsoTypeSelected") {
                    if (!skyObjView.flipped) {
960
                        container.state = "dsoAreaClicked"
961
                    } else if (skyObjView.flipped) {
962 963 964
                        skyObjView.flipped = false
                    }
                }
965
            }
966
        }
967 968 969 970
    }

    Image {
        id: settingsIcon
971
        objectName: "settingsIconObj"
972
        x: 9
973
        y: container.height - 50
974 975
        width: 28
        height: 28
976 977 978 979 980 981 982 983
        anchors{
            verticalCenterOffset: 0
            verticalCenter: backButton.verticalCenter
        }
        sourceSize{
            height: 40
            width: 40
        }
984 985 986 987
        smooth: true
        fillMode: Image.Stretch
        source: "settingsIcon.png"

988
        signal settingsIconClicked
989

990 991 992
        MouseArea {
            id: settingsMouseArea
            anchors.fill: parent
993
            hoverEnabled: true
994
            onEntered: settingsForeground.opacity = buttonOpacity
995
            onExited: settingsForeground.opacity = 0.0
996
            onClicked: settingsIcon.settingsIconClicked()
997 998 999 1000 1001 1002 1003