• May 18, 2024, 03:41:06 am

Author Topic: Changing a List Headings Background  (Read 831 times)

0 Members and 1 Guest are viewing this topic.

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
Changing a List Headings Background
« on: June 01, 2013, 04:39:40 am »
This is how to change the background of a list heading, too easy really:
Replace the
Code: [Select]
source: privateStyle.imagePath("qtg_fr_list_heading_normal", root.platformInverted)
With:
Code: [Select]
source: "enter image path here"

Which makes this:

Code: [Select]
import QtQuick 1.1
import "." 1.1

Item {
    id: root
    property alias paddingItem: paddingItem // Read-only
    property bool platformInverted: false

    implicitWidth: ListView.view ? ListView.view.width : screen.width
    implicitHeight: platformStyle.graphicSizeSmall

    BorderImage {
        source: "enter image path here"
        border { left: 28; top: 0; right: 28; bottom: 0 }
        smooth: true
        anchors.fill: parent
    }

    Item {
        // non-visible item to create a padding boundary that content items can bind to
        id: paddingItem
        anchors {
            fill: parent
            leftMargin: platformStyle.paddingLarge
            rightMargin: privateStyle.scrollBarThickness
            topMargin: platformStyle.paddingSmall
            bottomMargin: platformStyle.paddingSmall
        }
    }
}

Either copy the above code and paste it into a new QML file and define it in you're code as if you would with a normal component.


Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: Changing a List Headings Background
« Reply #1 on: June 01, 2013, 05:00:36 am »
saw this in some apps (e.g. by dickson) but didn't know how it works, thank for the help.