~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to backends/kylin-assistant-daemon/data/beautify/plymouth/defaults/only_background.script

  • Committer: lixiang
  • Date: 2018-03-06 03:13:06 UTC
  • Revision ID: lixiang@kylinos.cn-20180306031306-fd7qnru3vm4a1xjd
Rewrite with Qt5, and add system monitor

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  ubuntukylin-logo.script - boot splash plugin
 
2
 
3
#  Copyright (C) 2009 Canonical Ltd.
 
4
#  Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd.
 
5
#  This program is free software; you can redistribute it and/or modify
 
6
#  it under the terms of the GNU General Public License as published by
 
7
#  the Free Software Foundation; either version 2, or (at your option)
 
8
#  any later version.
 
9
 
10
#  This program is distributed in the hope that it will be useful,
 
11
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#  GNU General Public License for more details.
 
14
 
 
15
logo.image = Image("customBG.png");
 
16
 
 
17
logo.screen_x = Window.GetWidth();
 
18
logo.screen_y = Window.GetHeight();
 
19
logo.image_x = logo.image.GetWidth();
 
20
logo.image_y = logo.image.GetHeight();
 
21
 
 
22
logo.scale_factor_x =  Window.GetWidth() / logo.image.GetWidth();
 
23
logo.scale_factor_y =  Window.GetHeight() / logo.image.GetHeight();
 
24
 
 
25
if(logo.scale_factor_x >= 1 && logo.scale_factor_y >= 1){
 
26
        logo.scale_factor = 1;
 
27
}
 
28
else{
 
29
        if(logo.scale_factor_x > logo.scale_factor_y){
 
30
                logo.scale_factor = logo.scale_factor_y;
 
31
        }
 
32
        else{
 
33
                logo.scale_factor = logo.scale_factor_x;
 
34
        }
 
35
}
 
36
 
 
37
logo.scaled_image = logo.image.Scale(logo.image.GetWidth()  * logo.scale_factor,
 
38
                                     logo.image.GetHeight() * logo.scale_factor);
 
39
 
 
40
logo.sprite = Sprite(logo.scaled_image);
 
41
 
 
42
logo.sprite.SetX(Window.GetWidth()  / 2 - logo.scaled_image.GetWidth () / 2);
 
43
logo.sprite.SetY(Window.GetHeight() / 2 - logo.scaled_image.GetHeight() / 2);
 
44
logo.sprite.SetZ(-10000);