55
55
const double DEFAULT_DPI = 96.0f;
57
gboolean get_app_installed(const gchar *app_name)
59
gchar *path = g_find_program_in_path(app_name);
57
67
void Style::UpdateDPI()
59
69
GSettings *ubuntu_ui_settings = g_settings_new(UBUNTU_UI_SETTINGS.c_str());
111
121
left_arrow_pos_.x = 0.05 * (pri_monitor_width_ - ARROW_WIDTH);
112
122
left_arrow_pos_.y = 0.5 * (pri_monitor_height_ - ARROW_HEIGHT);
114
right_arrow_pos_.x = 0.95 * (pri_monitor_width_ - ARROW_WIDTH);
115
right_arrow_pos_.y = 0.5 * (pri_monitor_height_ - ARROW_HEIGHT);
117
124
base_pos_.x = 0.125 * pri_monitor_width_;
118
125
base_pos_.y = 0.25 * pri_monitor_height_;
121
128
title_pos_.y = 0.25 * pri_monitor_height_;
123
130
subtitle_pos_.x = title_pos_.x;
124
subtitle_pos_.y = 0.35 * pri_monitor_height_;
131
subtitle_pos_.y = 0.33 * pri_monitor_height_;
126
133
details_pos_.x = title_pos_.x;
127
134
details_pos_.y = 0.4 * pri_monitor_height_;
129
136
close_pos_.x = 0.5 * pri_monitor_width_;
130
137
close_pos_.y = 0.9 * (pri_monitor_height_ - launcher_size_);
132
page_ind_pos_.x = 0.75 * pri_monitor_width_;
133
page_ind_pos_.y = close_pos_.y + (CLOSE_BUTTON_HEIGHT - PAGE_IND_HEIGTH) / 2;
135
139
spot_pos_.x = (base_pos_.x + 422 + title_pos_.x) / 2;
136
140
spot_pos_.y = 0.25 * pri_monitor_height_;
143
147
left_arrow_pos_.x = 0.05 * (pri_monitor_width_ - ARROW_WIDTH) + launcher_size_;
144
148
left_arrow_pos_.y = 0.5 * (pri_monitor_height_ - ARROW_HEIGHT);
146
right_arrow_pos_.x = 0.95 * (pri_monitor_width_ - ARROW_WIDTH);
147
right_arrow_pos_.y = 0.5 * (pri_monitor_height_ - ARROW_HEIGHT);
149
150
base_pos_.x = 0.55 * pri_monitor_width_;
150
151
base_pos_.y = 0.25 * pri_monitor_height_;
153
154
spot_pos_.y = 0.25 * pri_monitor_height_;
155
156
title_pos_.x = 0.125 * pri_monitor_width_;
156
title_pos_.y = spot_pos_.y - 70;
157
title_pos_.y = spot_pos_.y;
158
159
subtitle_pos_.x = title_pos_.x;
159
subtitle_pos_.y = spot_pos_.y + 10;
160
subtitle_pos_.y = 0.33 * pri_monitor_height_;
161
162
details_pos_.x = title_pos_.x;
162
details_pos_.y = subtitle_pos_.y + 10;
163
details_pos_.y = 0.4 * pri_monitor_height_;
164
165
close_pos_.x = 0.125 * pri_monitor_width_;
165
166
close_pos_.y = 0.9 * (pri_monitor_height_ - launcher_size_);
167
page_ind_pos_.x = 0.75 * pri_monitor_width_;
168
page_ind_pos_.y = close_pos_.y + (CLOSE_BUTTON_HEIGHT - PAGE_IND_HEIGTH) / 2;
170
168
inflexion_pos_.x = (launcher_size_ + title_pos_.x) / 2;
171
169
inflexion_pos_.y = (panel_height_ + base_pos_.y) / 2; // This is only use for the last page(indicator).
172
right_arrow_pos_.x = 0.95 * (pri_monitor_width_ - ARROW_WIDTH);
173
right_arrow_pos_.y = 0.5 * (pri_monitor_height_ - ARROW_HEIGHT);
175
page_ind_pos_.x = 0.75 * pri_monitor_width_;
176
page_ind_pos_.y = close_pos_.y + (CLOSE_BUTTON_HEIGHT - PAGE_IND_HEIGTH) / 2;
174
178
icon_order_[0] = LAUNCHER;
175
179
icon_order_[1] = 0;
176
180
icon_order_[2] = get_icon_order("Nautilus");
177
icon_order_[3] = get_icon_order("youker-assistant");
181
if (get_app_installed("youker-assistant"))
182
icon_order_[3] = get_icon_order("youker-assistant");
184
icon_order_[3] = get_icon_order("Software");
178
185
icon_order_[4] = get_icon_order("unity-control-center");
179
186
icon_order_[5] = UNDER_PANEL;
252
259
std::string value = strings[i];
254
261
if (value.find("devices") != std::string::npos || value.find("running") != std::string::npos ||
255
value.find("expo-icon") != std::string::npos || value.find("ubiquity") != std::string::npos)
262
value.find("ubiquity") != std::string::npos)
258
265
if (!value.empty() && value.find(icon_name) != std::string::npos)