SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
Plasma Widgets




API and Theming approaches

       Marco Martin
What is a plasma widget?
●   KDE 4.0: everything from scratch
●   4.1/Qt4.4: QGraphicsWidget
●   Preferably a QGraphicsProxyWidget
    –   This means: every Qt widget you can imagine
●    Exception of container widgets, like
    TabWidgets and Frames
    –   We want to contain GraphicsWidgets and
        GraphicsLayouts here
Standard API: why wrap?
●   Normally you would do this:
  QPushButton *nativeButton = new QPushButton();
● QgraphicsProxyWidget *proxy = new QgraphicsProxyWidget(this);
  proxy->setWidget(nativeButton);
●   Very ugly code
●   And in scripting too, where we would want
    something better
●   Very scarce possibilities of theming
●   So every widget has its own subclass with a set
    of standard methods
What to wrap?
●   Most used functions
●   Makes the code simpler
●   In particular for scripted applets
●   Important functions
    –   setText() text() when the underlying widget has it
    –   setImage() getImage() aware of Plasma theme, so
        you can do setImage(“widgets/clock”)
Additional stuff
●   setStyleSheet()/styleSheet(): applet creators
    can easily tweak the widget appearance with
    standard Qt stylesheets
●   nativeWidget()
    –   ...when a basic api is not enough :)
    –   Not available in EcmaScript bindings to keep api
        clean
    –   Available in richer bindings like ruby
Theming
●   3 approaches
    –   Overriding the paint function of the proxywidget
         ●   Better graphics results (no clipping and float arithmetics)
         ●   Used for instance in Plasma::PushButton
    –   Subclass the QWidget and override paintEvent
         ●   When the widget is really complex and we need other
             stuff like a custom sizehint (and notification of its change)
         ●   Used in the tabbar
    –   Using a Kstyle: open possibility for scrollbars, easier
        to apply when they are only available children of
        other widgets (i.e. scrollviews)
What are themes?
●   QWidgets on canvas looks really out of place
●   A color scheme provided by Plasma::Theme
    and many svgs, described in
●   http://techbase.kde.org/Projects/Plasma/Theme
●   Svg element naming format used by the
    PanelSvg class
●   Useful to make more or less rectangular
    elements, so good for buttons, textboxes etc
Why not a single svg?
Example
●   9 element for each prefix, here the “normal”,
    pressed, active and the focus rect

Weitere ähnliche Inhalte

Was ist angesagt?

The Next Generation Qt Item Views
The Next Generation Qt Item ViewsThe Next Generation Qt Item Views
The Next Generation Qt Item Viewsaccount inactive
 
JS digest. January 2017
JS digest. January 2017JS digest. January 2017
JS digest. January 2017ElifTech
 
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive  3D graphics for web with three.js, Andrey Vedilin, DataArtInteractive  3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArtAlina Vilk
 
Demistifying the 3D Web - part 2
Demistifying the 3D Web - part 2Demistifying the 3D Web - part 2
Demistifying the 3D Web - part 2Pietro Grandi
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue APIOSInet
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017ElifTech
 
appborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemappborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemendian7000
 
Node.js 201: building real-world applications in pure JavaScript
Node.js 201: building real-world applications in pure JavaScriptNode.js 201: building real-world applications in pure JavaScript
Node.js 201: building real-world applications in pure JavaScriptTom Boutell
 
Xwt, a cross-desktop UI library
Xwt, a cross-desktop UI libraryXwt, a cross-desktop UI library
Xwt, a cross-desktop UI libraryJérémie Laval
 

Was ist angesagt? (12)

The Next Generation Qt Item Views
The Next Generation Qt Item ViewsThe Next Generation Qt Item Views
The Next Generation Qt Item Views
 
JS digest. January 2017
JS digest. January 2017JS digest. January 2017
JS digest. January 2017
 
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive  3D graphics for web with three.js, Andrey Vedilin, DataArtInteractive  3D graphics for web with three.js, Andrey Vedilin, DataArt
Interactive 3D graphics for web with three.js, Andrey Vedilin, DataArt
 
Lesson 08
Lesson 08Lesson 08
Lesson 08
 
Demistifying the 3D Web - part 2
Demistifying the 3D Web - part 2Demistifying the 3D Web - part 2
Demistifying the 3D Web - part 2
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue API
 
ngconf2015
ngconf2015ngconf2015
ngconf2015
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017
 
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
OpenCms Days 2014 Keynote - Step up to OpenCms 9.5
 
appborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemappborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-system
 
Node.js 201: building real-world applications in pure JavaScript
Node.js 201: building real-world applications in pure JavaScriptNode.js 201: building real-world applications in pure JavaScript
Node.js 201: building real-world applications in pure JavaScript
 
Xwt, a cross-desktop UI library
Xwt, a cross-desktop UI libraryXwt, a cross-desktop UI library
Xwt, a cross-desktop UI library
 

Andere mochten auch

Letni procházka s Ferdou 1
Letni procházka s Ferdou 1Letni procházka s Ferdou 1
Letni procházka s Ferdou 1HaKuPa
 
Marketing intelligence assessment
Marketing intelligence assessmentMarketing intelligence assessment
Marketing intelligence assessmentTag Urit
 
Thiền Triết lý Phật
Thiền Triết lý PhậtThiền Triết lý Phật
Thiền Triết lý PhậtMinh NghC
 
Tokamak2: themes and netbook shell
Tokamak2: themes and netbook shellTokamak2: themes and netbook shell
Tokamak2: themes and netbook shellMarco Martin
 
Tokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookTokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookMarco Martin
 
Z pohadkovych krajin
Z pohadkovych krajinZ pohadkovych krajin
Z pohadkovych krajinHaKuPa
 
Vocab Unidad 1.1
Vocab Unidad 1.1Vocab Unidad 1.1
Vocab Unidad 1.1Jeff Young
 
Smart Evaluation Considerations
Smart Evaluation ConsiderationsSmart Evaluation Considerations
Smart Evaluation Considerationsguest916929
 
Campkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookCampkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookMarco Martin
 
Akademy 2010 presentation
Akademy 2010 presentationAkademy 2010 presentation
Akademy 2010 presentationMarco Martin
 
Krasne fotky a vtipy
Krasne  fotky  a vtipyKrasne  fotky  a vtipy
Krasne fotky a vtipyHaKuPa
 
Podzimni prochazka s Ferdou 2
Podzimni prochazka s Ferdou 2Podzimni prochazka s Ferdou 2
Podzimni prochazka s Ferdou 2HaKuPa
 
10 10 How To Protect Your Bank Card
10 10 How To Protect Your Bank Card10 10 How To Protect Your Bank Card
10 10 How To Protect Your Bank CardMinh NghC
 

Andere mochten auch (18)

Letni procházka s Ferdou 1
Letni procházka s Ferdou 1Letni procházka s Ferdou 1
Letni procházka s Ferdou 1
 
Marketing intelligence assessment
Marketing intelligence assessmentMarketing intelligence assessment
Marketing intelligence assessment
 
Thiền Triết lý Phật
Thiền Triết lý PhậtThiền Triết lý Phật
Thiền Triết lý Phật
 
Tokamak2: themes and netbook shell
Tokamak2: themes and netbook shellTokamak2: themes and netbook shell
Tokamak2: themes and netbook shell
 
Tokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookTokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma Netbook
 
Z pohadkovych krajin
Z pohadkovych krajinZ pohadkovych krajin
Z pohadkovych krajin
 
Graphics Art 1
Graphics Art 1Graphics Art 1
Graphics Art 1
 
Vocab Unidad 1.1
Vocab Unidad 1.1Vocab Unidad 1.1
Vocab Unidad 1.1
 
Smart Evaluation Considerations
Smart Evaluation ConsiderationsSmart Evaluation Considerations
Smart Evaluation Considerations
 
Campkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbookCampkde 2010: KDE Plasma netbook
Campkde 2010: KDE Plasma netbook
 
Akademy 2010 presentation
Akademy 2010 presentationAkademy 2010 presentation
Akademy 2010 presentation
 
URSI 2008
URSI 2008URSI 2008
URSI 2008
 
Vocab 1.3
Vocab 1.3Vocab 1.3
Vocab 1.3
 
Krasne fotky a vtipy
Krasne  fotky  a vtipyKrasne  fotky  a vtipy
Krasne fotky a vtipy
 
Podzimni prochazka s Ferdou 2
Podzimni prochazka s Ferdou 2Podzimni prochazka s Ferdou 2
Podzimni prochazka s Ferdou 2
 
farm Animals
farm Animalsfarm Animals
farm Animals
 
10 10 How To Protect Your Bank Card
10 10 How To Protect Your Bank Card10 10 How To Protect Your Bank Card
10 10 How To Protect Your Bank Card
 
Kinder ppp numbers from 50 59
Kinder ppp numbers from 50 59Kinder ppp numbers from 50 59
Kinder ppp numbers from 50 59
 

Ähnlich wie KDE 4.1 Plasma widgets

Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfPrabindh Sundareson
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1NokiaAppForum
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)chan20kaur
 
PraveenKumar A T AWS
PraveenKumar A T AWSPraveenKumar A T AWS
PraveenKumar A T AWSPraveen Kumar
 
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...CybercomChannel
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarICS
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarJanel Heilbrunn
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Daker Fernandes
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksStoyan Nikolov
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersnuppla
 

Ähnlich wie KDE 4.1 Plasma widgets (20)

Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
 
Qt
QtQt
Qt
 
Qt Programming on TI Processors
Qt Programming on TI ProcessorsQt Programming on TI Processors
Qt Programming on TI Processors
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)
 
Qt coin3d soqt
Qt coin3d soqtQt coin3d soqt
Qt coin3d soqt
 
Qt for S60
Qt for S60Qt for S60
Qt for S60
 
PraveenKumar A T AWS
PraveenKumar A T AWSPraveenKumar A T AWS
PraveenKumar A T AWS
 
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
KDE Plasma Mobile workspaces at Cybercom Developer Day 2010 by Marco Martin 7...
 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
 
Cross Platform Qt
Cross Platform QtCross Platform Qt
Cross Platform Qt
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time Checks
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 
Webrender 1.0
Webrender 1.0Webrender 1.0
Webrender 1.0
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
 
Qt5 on ti processors
Qt5 on ti processorsQt5 on ti processors
Qt5 on ti processors
 

Kürzlich hochgeladen

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Kürzlich hochgeladen (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

KDE 4.1 Plasma widgets

  • 1. Plasma Widgets API and Theming approaches Marco Martin
  • 2. What is a plasma widget? ● KDE 4.0: everything from scratch ● 4.1/Qt4.4: QGraphicsWidget ● Preferably a QGraphicsProxyWidget – This means: every Qt widget you can imagine ● Exception of container widgets, like TabWidgets and Frames – We want to contain GraphicsWidgets and GraphicsLayouts here
  • 3. Standard API: why wrap? ● Normally you would do this: QPushButton *nativeButton = new QPushButton(); ● QgraphicsProxyWidget *proxy = new QgraphicsProxyWidget(this); proxy->setWidget(nativeButton); ● Very ugly code ● And in scripting too, where we would want something better ● Very scarce possibilities of theming ● So every widget has its own subclass with a set of standard methods
  • 4. What to wrap? ● Most used functions ● Makes the code simpler ● In particular for scripted applets ● Important functions – setText() text() when the underlying widget has it – setImage() getImage() aware of Plasma theme, so you can do setImage(“widgets/clock”)
  • 5. Additional stuff ● setStyleSheet()/styleSheet(): applet creators can easily tweak the widget appearance with standard Qt stylesheets ● nativeWidget() – ...when a basic api is not enough :) – Not available in EcmaScript bindings to keep api clean – Available in richer bindings like ruby
  • 6. Theming ● 3 approaches – Overriding the paint function of the proxywidget ● Better graphics results (no clipping and float arithmetics) ● Used for instance in Plasma::PushButton – Subclass the QWidget and override paintEvent ● When the widget is really complex and we need other stuff like a custom sizehint (and notification of its change) ● Used in the tabbar – Using a Kstyle: open possibility for scrollbars, easier to apply when they are only available children of other widgets (i.e. scrollviews)
  • 7. What are themes? ● QWidgets on canvas looks really out of place ● A color scheme provided by Plasma::Theme and many svgs, described in ● http://techbase.kde.org/Projects/Plasma/Theme ● Svg element naming format used by the PanelSvg class ● Useful to make more or less rectangular elements, so good for buttons, textboxes etc
  • 8. Why not a single svg?
  • 9. Example ● 9 element for each prefix, here the “normal”, pressed, active and the focus rect