~3v1n0/unity/overlay-border-scale

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/PanelStyle.cpp

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
}
54
54
 
55
55
Style::Style()
56
 
  : _theme_name(NULL)
 
56
  : panel_height(24)
 
57
  , _theme_name(NULL)
57
58
{
58
59
  if (style_instance)
59
60
  {
206
207
  }
207
208
 
208
209
  if (!texture)
209
 
    texture = GetWindowButtonForTheme(type, state);
 
210
    texture = GetFallbackWindowButton(type, state);
210
211
 
211
212
  return texture;
212
213
}
213
214
 
214
 
nux::BaseTexture* Style::GetWindowButtonForTheme(WindowButtonType type,
 
215
nux::BaseTexture* Style::GetFallbackWindowButton(WindowButtonType type,
215
216
                                                 WindowState state)
216
217
{
217
218
  int width = 18, height = 18;
230
231
    main = main * 1.2f;
231
232
  else if (state == WindowState::PRESSED)
232
233
    main = main * 0.8f;
 
234
  else if (state == WindowState::DISABLED)
 
235
    main = main * 0.5f;
233
236
 
234
237
  cr  = cairo_graphics.GetContext();
235
238
  cairo_translate(cr, 0.5, 0.5);
257
260
    cairo_move_to(cr, w, height / 2.0f);
258
261
    cairo_line_to(cr, width - w, height / 2.0f);
259
262
  }
260
 
  else
 
263
  else if (type == WindowButtonType::UNMAXIMIZE)
 
264
  {
 
265
    cairo_move_to(cr, w, h + h/5.0f);
 
266
    cairo_line_to(cr, width - w, h + h/5.0f);
 
267
    cairo_line_to(cr, width - w, height - h - h/5.0f);
 
268
    cairo_line_to(cr, w, height - h - h/5.0f);
 
269
    cairo_close_path(cr);
 
270
  }
 
271
  else // if (type == WindowButtonType::MAXIMIZE)
261
272
  {
262
273
    cairo_move_to(cr, w, h);
263
274
    cairo_line_to(cr, width - w, h);