comparison libgui/src/octave-dock-widget.cc @ 19895:19755f4fc851

maint: Cleanup C++ code to follow Octave coding conventions. Try to wrap long lines to < 80 characters. Use GNU style and don't indent first brace of function definition. "case" statement is aligned flush left with brace of switch stmt. Remove trailing '\' line continuation from the end of #define macros. Use 2 spaces for indent. * files-dock-widget.cc, history-dock-widget.cc, main-window.cc, octave-cmd.cc, octave-dock-widget.cc, octave-gui.cc, resource-manager.cc, settings-dialog.cc, shortcut-manager.cc, welcome-wizard.cc, workspace-view.cc, cellfun.cc, data.cc, debug.cc, debug.h, dirfns.cc, error.h, file-io.cc, gl-render.cc, gl-render.h, gl2ps-renderer.h, graphics.cc, graphics.in.h, help.cc, input.cc, load-path.cc, load-path.h, lookup.cc, lu.cc, oct-stream.cc, octave-default-image.h, ordschur.cc, pr-output.cc, qz.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc, variables.cc, zfstream.h, __fltk_uigetfile__.cc, __init_fltk__.cc, __magick_read__.cc, __osmesa_print__.cc, audiodevinfo.cc, ov-classdef.cc, ov-classdef.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-java.cc, ov-range.cc, ov-re-mat.cc, ov-usr-fcn.h, ov.cc, op-int.h, options-usage.h, pt-eval.cc, Array-C.cc, Array-fC.cc, Array.cc, Array.h, PermMatrix.cc, Sparse.cc, chMatrix.h, dSparse.cc, dim-vector.h, bsxfun-decl.h, bsxfun-defs.cc, oct-norm.cc, Sparse-op-defs.h, oct-inttypes.cc, oct-inttypes.h, main.in.cc, mkoctfile.in.cc: Cleanup C++ code to follow Octave coding conventions.
author Rik <rik@octave.org>
date Wed, 25 Feb 2015 11:55:49 -0800
parents 4197fc428c7d
children 2b5cbea8f442
comparison
equal deleted inserted replaced
19894:e8ccfc5d892b 19895:19755f4fc851
315 fg_col = _fg_color; 315 fg_col = _fg_color;
316 icon_col = _icon_color; 316 icon_col = _icon_color;
317 } 317 }
318 318
319 QString background = 319 QString background =
320 QString ("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," 320 QString ("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
321 " stop: 0 %1, stop: 0.75 %2, stop: 0.9 %2, stop: 1.0 %1);"). 321 " stop: 0 %1, stop: 0.75 %2, stop: 0.9 %2, stop: 1.0 %1);").
322 arg (bg_col.lighter ().name ()). 322 arg (bg_col.lighter ().name ()).
323 arg (bg_col.name ()); 323 arg (bg_col.name ());
324 324
325 #if defined (Q_OS_WIN32) 325 #if defined (Q_OS_WIN32)
326 css = background + QString (" color: %1 ;").arg (fg_col.name ()); 326 css = background + QString (" color: %1 ;").arg (fg_col.name ());
327 #else 327 #else
328 css = QString ("QDockWidget::title { " + background + 328 css = QString ("QDockWidget::title { " + background +
357 #if defined (Q_OS_WIN32) 357 #if defined (Q_OS_WIN32)
358 _title_widget->setStyleSheet (css); 358 _title_widget->setStyleSheet (css);
359 css_button = QString ("background: transparent; border: 0px;"); 359 css_button = QString ("background: transparent; border: 0px;");
360 _dock_button->setStyleSheet (css_button); 360 _dock_button->setStyleSheet (css_button);
361 _close_button->setStyleSheet (css_button); 361 _close_button->setStyleSheet (css_button);
362 _dock_action->setIcon (QIcon (":/actions/icons/" + dock_icon + icon_col + ".png")); 362 _dock_action->setIcon (QIcon (":/actions/icons/" + dock_icon + icon_col +
363 _close_action->setIcon (QIcon (":/actions/icons/widget-close" + dock_icon + icon_col + ".png")); 363 ".png"));
364 _close_action->setIcon (QIcon (":/actions/icons/widget-close" + dock_icon +
365 icon_col + ".png"));
364 #else 366 #else
365 setStyleSheet (css); 367 setStyleSheet (css);
366 #endif 368 #endif
367 } 369 }
368 370
372 _custom_style = 374 _custom_style =
373 settings->value ("DockWidgets/widget_title_custom_style",false).toBool (); 375 settings->value ("DockWidgets/widget_title_custom_style",false).toBool ();
374 376
375 QColor default_var = QColor (0,0,0); 377 QColor default_var = QColor (0,0,0);
376 _fg_color = settings->value ("Dockwidgets/title_fg_color", 378 _fg_color = settings->value ("Dockwidgets/title_fg_color",
377 default_var).value<QColor> (); 379 default_var).value<QColor> ();
378 default_var = QColor (0,0,0); 380 default_var = QColor (0,0,0);
379 _fg_color_active = settings->value ("Dockwidgets/title_fg_color_active", 381 _fg_color_active = settings->value ("Dockwidgets/title_fg_color_active",
380 default_var).value<QColor> (); 382 default_var).value<QColor> ();
381 383
382 default_var = QColor (255,255,255); 384 default_var = QColor (255,255,255);
383 _bg_color = settings->value ("Dockwidgets/title_bg_color", 385 _bg_color = settings->value ("Dockwidgets/title_bg_color",
384 default_var).value<QColor> (); 386 default_var).value<QColor> ();
385 default_var = QColor (192,192,192); 387 default_var = QColor (192,192,192);
386 _bg_color_active = settings->value ("Dockwidgets/title_bg_color_active", 388 _bg_color_active = settings->value ("Dockwidgets/title_bg_color_active",
387 default_var).value<QColor> (); 389 default_var).value<QColor> ();
388 390
389 int r, g, b; 391 int r, g, b;
390 _bg_color.getRgb (&r, &g, &b); 392 _bg_color.getRgb (&r, &g, &b);
391 if (r+g+b < 400) 393 if (r+g+b < 400)
392 _icon_color = "-light"; 394 _icon_color = "-light";
393 else 395 else
394 _icon_color = ""; 396 _icon_color = "";
395 397
396 _bg_color_active.getRgb (&r, &g, &b); 398 _bg_color_active.getRgb (&r, &g, &b);
397 if (r+g+b < 400) 399 if (r+g+b < 400)
398 _icon_color_active = "-light"; 400 _icon_color_active = "-light";
399 else 401 else
400 _icon_color_active = ""; 402 _icon_color_active = "";
401 403
402 notice_settings (settings); // call individual handler 404 notice_settings (settings); // call individual handler
403 405